Skip to content

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