Switching from Codeigniter, it was a breeze to do this in. I'm having trouble routing to nested controllers. It's letting me know the class doesn't exist. Here's my route
// These are my routes for the MDPay interface (Separate from the portal)
Route::resource('mdpay', 'mdpay/LoginController@index');
Here is my Controller embedded in the mdpay folder in controllers
class LoginController extends BaseController {
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$data['title'] = 'MDPay : ';
return View::make('mdpay/start', array('title'=>$data['title']) );
}
}
When using the route I'm getting this error:
ReflectionException Class mdpay/LoginController does not exist
I'm confused as to how I'm routing wrong. This was working fully until I decided to nest the path under the mdpay folder in the controllers. :(
In your composer.json file, you can see the
'autoload' : {
'classmap' : {
...
}
section, add your path to the directory of your controller, then type:
./composer.phar dump-autoload
I looks like:
Route::resource('mdpay', 'LoginController');
should work.
You can then run:
php artisan routes
to see what's going on.
If you want a route prefix you could:
Route::group(['prefix' => 'dirname'], function()
{
Route::resource('mdpay', 'LoginController');
});
Thanks, this helped out, but I found the fix after coming back from lunch. I was calling the entire path when all I needed to call was the library. So, the full solution instead of mdpay/LoginController@index, it was simply just LoginController@index.
bomberman1990 said:
In your composer.json file, you can see the
'autoload' : { 'classmap' : { ... }
section, add your path to the directory of your controller, then type:
./composer.phar dump-autoload
I saw this after I posted. This is exactly what needed to happen to work. Thanks :)
rags02 said:
I looks like:
Route::resource('mdpay', 'LoginController');
should work.
You can then run:
php artisan routes
to see what's going on.
If you want a route prefix you could:
Route::group(['prefix' => 'dirname'], function() { Route::resource('mdpay', 'LoginController'); });
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community