This is my Laravel route where I am getting value from as 'q' from a form to perform search from quiz table.
Route::get('/admin/Searchquizzes',function ($q) {
$quizzes = DB::table('quiz')
->leftjoin('category', 'quiz.category_id', '=', 'category.id')
->where('name','LIKE','$q')
->select('quiz.*', 'category.name As category_name')
->get();
$categories = DB::table('category')->select('id', 'name')->get();
return view('admin/quizlisting', ['quizzes' => $quizzes, 'categories' => $categories]);
)->middleware('auth')->name('admin.Searchquizzes');
This is code for my laravel Form to perform search ..
<div class="input-group">
<input type="text" name="q" id="q" class="form-control" placeholder="Search...">
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
This is not working I don't know why, help shall be appreciated.
}for the closure (function). How is it not working exactly?