mardi 26 janvier 2016

Laravel 5 routing notworking

Im trying to get parameter from a route, But its not working properly

this is my route

Route::get('reports/{id}', 'ReportsController@show');

and this is my controller

public function show($id) {
    return Reports::all()->where('user_id', $id );
}

when access the route, 'reports/1' it returns nothing, but the below code is working

public function show($id) {
    return Reports::all()->where('user_id', 1 );
}

I donno whats wrong with my code, Please help. Thanks in advance. :)



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1nMnSr9
via IFTTT

Aucun commentaire:

Enregistrer un commentaire