mercredi 23 décembre 2015

In Laravel 5, how can I move the controllers out of the 'app' folder

I am placing all the classes codes in a separate folder. I have created a folder 'src' alongside the folder 'app'. Within this 'src' folder will be 'Models', 'Views' and 'Controllers' folder and 'routes.php' file too. So the scructure will be as follows.

  • app
  • src
    • Controllers
    • Models
    • Views
    • routes.php

I have moved the routes.php and views to src by changing the routing path in 'app\Providers\RouteServiceProvider.php' and view path in 'config/view.php'. Please correct me if I did anything wrong here.

My question is - how can I move controllers, models, views and route.php from app to src?

I want to do this because I want to palce all the user written codes in one place. I don't want to move the app/Http/Controllers/Controller.php. I just want to move the user created controllers.

I want to achive this without braking anything at other places.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire