can you show the view ?
Mar 15, 2016
4
Level 70
Token display in search URL
I made a search item for searching user profile. Everything working perfectly but when I search my csrf_token() value displays with search url.
For example, my expected search URL is search/profile?query=suchi. But when I search, it comes with following URL- search/profile?query=suchi&_token=Za2TAprLqTXapnIsSzmvHD5OgrlQRbkaEf1HBKGi
My search controller is-
public function getProfileResult(Request $request){
$query = $request->input('query');
if ( !$query ) {
return redirect()->route('home');
}
$profiles = User::where('uName', 'LIKE', "%{$query}%")
->get();
return view('search.profile')->with('profiles', $profiles);
}
Can you please help me?
Level 41
Lol. He meant your view file / blade file.
Since this is a GET request, you don't need to pass the csrf token so just take it out of your form.
1 like
Please or to participate in this conversation.