index.blade.php
<td class="sorting_1" style=""></td>
<td></td>
TicketController
public function index(Request $request)
{
$data = Ticket::with('User','Kategori','Prioritas','Status')->when($request->keyword, function ($query) use ($request)
{
$query->where('judul', 'like', "%{$request->keyword}%");
})->paginate(5);
$data->appends($request->only('keyword'));
return view('admin.crud_ticket.index', compact('data'));
}
model Ticket
public function user()
{
return $this->belongsTo(User::class);
}
model User
public function ticket()
{
return $this->hasMany(Ticket::class);
}
if you have a solution to the problem that i am experiencing please help me
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3wde9gD
via IFTTT
Aucun commentaire:
Enregistrer un commentaire