Laravelde kısaca search inputunda yazıları arama nasıl yapabilirim anlatabilir misiniz ?
Şöyle bir yere kadar geldim...
Route'ım
Route::get('{project}', 'ProjectController@show')->name("projects.show");
Controllerım
public function show(Project $project, Request $request)
{
$search = $request->input('search');
$questions = Question::where('content','like','%$search%');
return view("projects.show")->with("project", $project)->with('questions', $questions);
}
Yalnız şöyle bir şey var, tüm soruları değil bulunduğu projedeki soruları getirmesi gerekiyor. Burdan sonra blade kısmı nasıl olması gerekir ?