Skip to content

[12.x] Consistency with Laravel's best practices #10254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2025
Merged

[12.x] Consistency with Laravel's best practices #10254

merged 1 commit into from
Mar 16, 2025

Conversation

AhmedAlaa4611
Copy link
Contributor

Problem:
The explicit using for use App\Http\Controllers\Controller; in Laravel controllers is unnecessary when the base controller Controller.php is in the same namespace. Since Laravel's artisan make:controller command does not include this import, and Laravel Pint also removes it, it makes sense to align the documentation with this convention.

Reasons:

  • The import statement is redundant because the base Controller is in the same namespace.
  • Laravel's artisan command does not generate this import.
  • Laravel Pint removes it as an unnecessary statement.

Updating the documentation will ensure consistency with Laravel's best practices.

@taylorotwell taylorotwell merged commit 690f920 into laravel:12.x Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants