dimanche 16 mai 2021

I always get this error Trying to get property 'nama_lengkap' of non-object

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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire