Support the ongoing development of →
posted 9 years ago
Last updated 2 years ago.

Gouvi said:

This video helped me:

Thanks brother, however I cannot understand what you mean with this example. Because,

  1. It suits L4 not L5
  2. I could not see a modular structure on it.

It's mainly the concept, I implemented this with L5 with no problem. You can still setup an Admin controller and a Client controller. You can then inject a Request handler in each controller to check if the Auth::user()->hasRole('admin') or if the Auth::user()->hasRole('client').


I haven't used this package yet, but looks like it would be a good starting point for what you'd like to do:

Just remember you can customize the folder structure of L5 however you want to without having to do anything too involved. If you want to change the views location you can do that inside the config file. Or if you want to put your controllers in say App/Admin/Controllers, just create the directory put your controllers in there, and then just reference the namespace in your routes (using route groups make this less tedious). I hope this points you in the right direction!


Keeping your logic seperate is as simple as PSR4 namespacin your classes & Folders.

Some things you should take care:

  1. If you change your controllers namespace you must adjust the setting in RouteServiceProvider.php:

     protected $namespace = 'App\Http\Controllers';

OR altenative leave it blank and use the full class name of your controller in your routes file

  1. To move your default views folder edit config\views.php and add your paths. This is the default settings

     'paths' => [

You could also try a package I've created that will help you to keep your views & assets seperated: igaster/laravel-theme

Last updated 9 years ago.

Hi everyone; I solved this problem using a few tricks which I explained at my blog :

Thanks everyone.


doktoresperanto said:

Hi everyone; I solved this problem using a few tricks which I explained at my blog :

Thanks everyone.

looks good


Sign in to participate in this thread!


Your banner here too?

ziyahan ziyahan Joined 2 Mar 2015


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.