I'm starting to work with Laravel 4, it seems to be a great choice, anyway before coding my first project i'd like to understand if my usual approach could be ok with laravel.
Usually i keep triad for backend and frontend separated under a /modules folder, like this:
/modules
/backend
/config
/controllers
/models
/migrations
/ecc..
/frontend (and so on...)
With laravel i'm not really sure how to manage this. I'm trying with packages, but the php artisan workbench me/mypackage --resources
don't build the entire folder structure... where to put controllers and models, and how to setup routes?
Then i found this link to enable modules-like system. So, what's the approach i should follow for keeping things in the laravel way?
正确答案
12 | Well, let's begin... First, I created
In the answers, I will use this exact package as example. Imagine, that folder Q: how to setup routes Q: where to put controllers and models
I created the
As you can see, I used namespaces, so you should. Important: after creating those files, you need to update
After this, dump the changes using Q: So, what's the approach i should follow for keeping things in the laravel way? I hope this helps you, good luck! Edit
Returning view from package's controller is pretty simple
| |||
来自 http://stackoverflow.com/questions/18132220/laravel-4-package-or-modules
app/routes.php
as well. You do not have to use namespaces at packages (or app) at all - it's up to you, but namespaces can make your live easier. – Andreyco Aug 11 '13 at 18:07