1
votes

I'm using Laravel 5.1 and the modular package: https://github.com/Artem-Schander/L5Modular

I created an admin modul with the following route file:

Route::group(array('module' => 'Admin', 'namespace' => 'App\Modules\Admin\Controllers'), function() {

Route::get('admin/test', 'AdminController@createTestView');

}); 

When I call http://localhost/admin/test it redirects me to the test view. When I call http://localhost/admin/test2 it redirects me to my 404.blade.php file which I create for pages which does not exist anymore.

When I call http://localhost/admin I get the following error message in the browser: "The requested resource /Site was not found on this server."

Any ideas why it does not redirect to the 404.blade.php site? Thank you

1

1 Answers

0
votes

You don't have a route for admin/test2, that's why you're getting 404 error. If you want to pass an ID to your controller, you should create route with a parameter: admin/test{id}

UPDATE:

Route::group(array('module' => 'Admin', 'namespace' => 'App\Modules\Admin\Controllers'), function() {

    Route::get('admin/{someParam}', 'AdminController@createTestView');

});

Then in a createTestView action:

public function createTestView($someParam){
    dd($someParam); // Shows you contents of $someParam
}