0

As the title suggests, I am resurrecting an old Laravel project (from v5) and upgrading to v8.

In my blade template I referred to $request->q which would get the q=somevalue part of my url, in laravel 8 however this doesn't work.

I have tried a number of methods found in this SO post but none of them work.

InvalidSyntax
  • 9,131
  • 20
  • 80
  • 127

2 Answers2

5

Have you tried request() helper function with one of these

request('q')
request()->get('q')
request()->query('q')
mmabdelgawad
  • 2,385
  • 2
  • 7
  • 15
0

I had this issue too but Still, it will works, when it in this way

Controller

  • in here this should have use Illuminate\Http\Request;

public function func1(Request $request){ $aid=$request->id; }

Route

Route::get('/url_name/{id}',[
    'as'=>'url_name',
    'uses'=>'ControllerName@func1'
]);

Blade

<form id="form_1" action="{{'/url_name',$id)}}" method="POST" enctype="multipart/form-data">

OR

You can try with, $request['q'];

vidu
  • 21
  • 6