I am trying to create a modular system in Laravel 4.1.
I have folders like following:
app
app/controllers
app/controllers/BaseController.php
app/views/
app/modules/
app/modules/moduleName/
app/modules/moduleName/routes.php
app/modules/moduleName/controllers/
app/modules/moduleName/controllers/module.php
When I try to extend BaseController
, I use namespaces and I get the following error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'Illuminate\Session' not found
Here is my module.php codes:
<?php namespace App\Modules\Twitter\Controllers;
use Illuminate\Routing\Controllers\Controller;
class Modulename extends Controller {
}
I have two questions.
- How can I call session classes in modules?
- I have route.php file in every module but still can't route the modules. Hence I am supposed to use laravel default routes.php file. How can I solve this problem?
Thanks anyway.