laravellaravel-bladelaravelcollectivelaravel-controller

Can not use controller name in laravel, must use namespace


Blade view and PostsController

When I use {!! Forms::open(['method'=>'post', 'action'=>'PostsController@store']) !!} It errors out.

But when I use {!! Forms::open(['method'=>'post', 'action'=>'App\Http\Contollers\PostsController@store']) !! It works.

Why cant I just use Controller name instead of namespace name?

Thanks for help.


Solution

  • In RouteServiceProvider.php uncomment protected $namespace = 'App\Http\Controllers'; this line