0

I want to change Laravel project's paths (View, Lang, Controller, Model...etc), because my project uses these files from subdomains folders, but i dont know where to modify the framework.

Csongi30
  • 13
  • 2
  • 2

2 Answers2

1

You can try this way:

  1. Extend the base Application class Illuminate\Foundation\Application
  2. in your derived app class override all the path functions
  3. in bootstrap/app.php change this line to load your derived App class

    $app = new Illuminate\Foundation\Application(..
    $app = new MyApplication(..
    

Cross your fingers.

dparoli
  • 8,891
  • 1
  • 30
  • 38
  • It's a good start point.The problem with overriding path functions is that actually I'd like to modify the logic which loads files. I've found that FielViewFinder and ClassLoader classes load the files. My idea would be to derive from these classes, and to get Laravel to use my loader instances. Maybe this can be done by deriving from Application, now I'm looking for where the loader classes get new()-ed or something.(If it helps, I want the app to load specific files from a subdomain-specific folder, and if a particular file doesn't exist there, then it'd load the file from the default path.) – Csongi30 Feb 21 '17 at 18:51
  • Personal opinion follows: I will go for multiple installs of laravel projects one for each subdomain, I never did anything like this but I think you can share the vendor folder. Subclassing ClassLoader and load files conditionally seems IMHO a lot of work withtout any assurance on the final result. – dparoli Feb 22 '17 at 09:07
0

If you mean change the path of the app folder, you can change this in the filesystems config (in /config/filesystems.php):

Set

'root'   => storage_path().'/app',

to whatever path you want.

Pim
  • 5,626
  • 4
  • 19
  • 27