return redirect('home1', compact ('dbreturn'));
{{ $dbreturn->links() }}
Pagination is working properly for home view but its not working for category views same controller im using for categories and its separate by using routes, pl help me:
this is my controller:
$form1=new form1;
$form1->name=$request->yourname;
$form1->email=$request->email;
$form1->tp=$request->tp;
$form1->heading=$request->subject;
$form1->text=$request->message;
$form1->price=$request->price;
$form1->nego=$request->exampleRadios;
$form1->cate=$request->category;
$form1->image=$filepath;
$form1->image2=$filepath2;
$form1->image3=$filepath3;
$form1->save();
//dd($form1);
$dbreturn=form1::latest()->paginate(8);
//dd($dbreturn);
return redirect('home1')->with('form1',$dbreturn);
this is my home route and its working properly:
Route::get('/home1', function () { $data=App\form1::latest()->paginate(8); return view('home1')->with('form1',$data);
and this is my mobilephone category, its not woking error message is on title:
Route::get('/mobilephones', function () { $data=App\form1::latest()->where('cate', '=', '1')->paginate(8); return view('mobilephones')->with('form1',$data);
and this is my mobileptone blade file:
@foreach($form1 as $form)
<div class="col-sm">
</br>
<div class="card" style="width: 18rem;">
<img src="{{ $form->image }}" class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title">{{$form->heading}}</h5>
<p class="card-text">{{$form->text}}</p>
<b class="card-price">₨{{number_format($form-
>price,2)}} {{$form->nego}}</b><br>
<h class="time" class="card-text">{{$form->created_at->diffForHumans()}}
</h>
<a href="/viewformdata/{{$form->id}}" class="btn btn-primary"> See
More</a>
</div>
</div>
</div>
@endforeach
</div>
</div>
</br>
</div>
<div class="container">
<p5 class="pagi" style="font-size: 35px; ">{{ $form1->links() }}</p5>
Please or to participate in this conversation.