Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$request not working on laravel get method

I have a route

Route::get('student-search', 'Students@search')

and url on browser

student-search?session=2&name=raj&grade=1&section=a

But while returning $request its returning empty . Same thing is working fine on local but not working after trnsferring it to server.

code of search function looks like this

public function search(Request $request){
        return $request;
...

and $request returns empty . While same thing is working on localhost.

like image 368
salin kunwar Avatar asked Nov 09 '17 10:11

salin kunwar


1 Answers

What you are missing is your server is not passing query parameter in any form of request. If you are using nginx try

location / {
                try_files $uri $uri/ /index.php?$args;                
           }
like image 77
Niroj Adhikary Avatar answered Sep 25 '22 05:09

Niroj Adhikary