Reputation: 33
First of all, I'm not a native English speaker so please understand some clumsy expressions I may use if there any :)
I just started some days ago with this excellent framework, and now I want to use it for many projects our company is running at the moment.
It doesn't seem that hard to manage just a single project with Laravel since I don't really have to care much about sub-folders, namespaces, and etc.
When it comes to multiple projects, however, I can't get how I can seperate controllers and models for each projects
To be more specifically speaking,
How can I make controllers & model work when they are in the sub folders?
For instance,
Route::post('entries','entries@create');
the above one runs fine, since "entries.php" file is located at "controllers" folder, but what if the controller "entries.php" is in a sub-folder?
how can I specify the path of the sub-folder-located file so that a code at the above automatically finds it?
The same question goes with the case of models too.
Upvotes: 3
Views: 548
Reputation: 1923
Within routes.php
Route::post('entries','folder.entries@create');
The "entries" controller file within the "folder" folder.
class Folder_Entries_Controller extends Base_Controller {
public function action_index()
{
// Code Here
}
}
Upvotes: 3