Reputation: 547
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::get('/', function () {
return view('welcome');
});
Route::get('einlagerungen/{$paletten_id}/bei_paletten_id', [
'as'=>'einlagerungen/bei_paletten_id', 'uses'=>'EinlagerungRestController@beiPalettenId'
]);
class EinlagerungRestController extends Controller
{
...
public function beiPalettenId($paletten_id)
{
return "it works";
}
....
}
Upvotes: 4
Views: 9641
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