mardi 3 juillet 2018

Laravel: display multi data in one row for every user

How I can display multi data in one row with foreign key by id user for example: I have users with multi ticket, i need to display for every user number of his tickets in one column.

enter image description here

this my controller

public function followticket()
{
    $data = DB::table('tickets')
        ->join('users', 'users.id', '=', 'tickets.user_id')
        ->select('users.*', 'tickets.*')->get();

    return view('Admin.suivi-tickest',compact('data'));
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire