jeudi 17 décembre 2015

Method with does not exist

Below is my code to get all users and role info for each user.

$Users = \App\Models\User\User_Model::all()
        ->with("Role")->get();
return view("User.List", array("Users" => $Users));

In my user model, A function is defined like below.

public function Role()
{
    $this->hasOne("\App\Models\User\Role_Model", "RoleID");
}

I am getting below error

Method with does not exist.

Question ? Am I missing anything ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire