Basic Controllers: Controllers & Namespaces

Controllers & Namespaces

Route::get('foo', 'Photos\AdminController@method');

Since the RouteServiceProvider loads your route files within a route group that contains the namespace, we only specified the portion of the class name that comes after the App\Http\Controllers portion of the namespace.

If you choose to nest your controllers deeper into the App\Http\Controllers directory, use the specific class name relative to the App\Http\Controllers root namespace.

Basic Controllers: Controllers & Namespaces — Structure map

Clickable & Draggable!

Basic Controllers: Controllers & Namespaces — Related pages: