mercredi 13 novembre 2019

How to select multiple columns with pluck() from selection in laravel

The probleme is that when dd($responsablle or $type) its shows only first_name i need to select first_name and id

public function create(){
        $responsable = User::all()->pluck('first_name','id');
        $type = EventType::all()->pluck('type','id');
        return view ('backend.event.create', compact('responsable', 'type'));
    }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire