vendredi 23 mars 2018

Sending multiple variables from controller to view with Laravel

Can someone please help me fixing this? I am getting a 'Undefined variable: roles' error on the view with this in the controller:

public function create() {

    $offices = Office::pluck('name', 'id');
    $roles = Role::pluck('name', 'id');

    return view('gebruikers.create')->with('offices', $offices, 'roles', $roles);
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire