Thomas Kaemmerling
Thomas Kaemmerling

Reputation: 547

Laravel Routing: page you are looking for could not be found

I have a defined a rout in Laravel but when i call the route I Get 404 (Sorry, the page you are looking for could not be found.)

The Route is: einlagerungen/{$paletten_id}/bei_paletten_id

Route Definitions

Route::get('/', function () {
    return view('welcome');
});

Route::get('einlagerungen/{$paletten_id}/bei_paletten_id', [
   'as'=>'einlagerungen/bei_paletten_id', 'uses'=>'EinlagerungRestController@beiPalettenId'
]);

Controller Code

class EinlagerungRestController extends Controller
{
    ...

    public function beiPalettenId($paletten_id)
    {   
        return "it works";
    }

    ....

}

Upvotes: 4

Views: 9641

Answers (1)

mleko
mleko

Reputation: 12243

You don't need dollar sign

Try

Route::get('einlagerungen/{paletten_id}/bei_paletten_id', [
   'as'=>'einlagerungen/bei_paletten_id', 'uses'=>'EinlagerungRestController@beiPalettenId'
]);

http://laravel.com/docs/5.1/routing#required-parameters

Upvotes: 2

Related Questions