Support the ongoing development of →
Requests Database Eloquent
Last updated 2 years ago.

have you defined the relationship between profile and role models correctly ?


yes i have defined it correctly

Here is the code block of User model

public function profile()
        return $this->hasOne('App\Profile','user_id');

Here is the code block of Profile model

public function user()
        return $this->belongsTo('App\User','user_id');
Last updated 8 years ago.

so what was the problem cause i have 3 tables all relationship right but i cant do the update i dont know the method how it work all i did was this so far

 public function update(StoreUser $request, User $user){
        $user = User::findOrFail($user);


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.