Internal Server Error Exception Property [name] does not exist on this collection instance. in Laravel 11

 



SOLUTION :
In app\Http\Controllers\UserController File
Update
public function show(User $user)
    {
        $users = User::find($user);
        return view("viewuser",compact("users"));
    }
This Error is occurred due to above code. So Change above code as shown below :


public function show(string $id)
    {
        $users = User::find($id);
        return view("viewuser",compact("users"));
    }

Comments

Popular posts from this blog

Illuminate\Database\QueryException SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (Connection: mysql, SQL: alter table `roles` add unique `roles_role_name_unique`(`role_name`)) in Laravel 11