you can create the workbench
for manage multiple app.
grindmodeon said:
I personally put them in sub-folders. So I would have the following:
app/controllers/User/DashboardController.php
class UserDashboardController extends Controller { public function index() { return View::make('user.index'); } }
app/controllers/Admin/DashboardController.php
class AdminDashboardController extends Controller { public function index() { return View::make('admin.index'); } }
And so on.. Then your routes.php would look like:
Route::get('users/dashboard', 'UserDashboardController@index'); Route::get('admin/dashboard', 'AdminDashboardController@index');
A TIP: When doing this, you may need to run composer dump-autoload for Laravel routes to load your controllers when putting them into sub-folders.
Hopefully that helps or gets you going in the right direction.
Thanks, I was considering the same approach. Do you think it is a good idea to use namespaces for controllers, so that they are loaded automatically without the need for composer dump-autoload
?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community