Hi all developer do you have any idea with my error ,I tried to use paginate with query "LIKE" select statement in laravel 7 , everything is ok but when try to click on page 2 or move to next page I'm got the error message
Thank you
**My error message **
The GET method is not supported for this route. Supported methods: POST.
( http://127.0.0.1:8000/students/student/find/subject?page=2)
public function index(Request $request)
{
$par = $request->input('search');
$result = DB::table('tbl_couse_title')->select()
->where('del','=','N')
->where('couse_type', 'LIKE' , '%' .$par. '%')
->orWhere('page_name','LIKE', '%'.$par.'%')
->paginate(2);
return view('students.stu_list_search',compact('result'));
}
web.php
Route::get('/stu_index','students\Dashboard_students@index')->name('stu_index')->middleware('student');
Route::post('students/student/find/subject','students\student_search_index@index')->name('stu_list_search')->middleware('student');
Blade
<label for="result" class="mt-2" style="float:right;">Result:10</label><br />
@foreach($result as $row)
<div class="list-group mt-3 mb-3">
<div class="list-group-item list-group-item-action flex-column align-items-start">
<div class="row">
<div class="col-md-2">
<img src="" class="rounded-circle mx-auto d-block" style="width:100px; height:100px;">
</div>
<div class="col-md-8">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1"></h5>
</div>
<p class="mb-1"></p>
<small class="text-muted">Contact</small>
</div>
<div class="col-md-2" style="text-align:right;padding-top:25px;">
<a href=""><button class="btn btn-success btn-sm"><i class="fa fa-eye"></i>Detail</button></a>
<a href=""><button class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> Join</button></a>
</div>
</div>
</div>
</div>
@endforeach
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire