Support the ongoing development of Laravel.io →
Requests Database Eloquent
Last updated 1 year ago.
0

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

0

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 7 years ago.
0

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);

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

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

Your logo here?

Laravel.io

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

© 2024 Laravel.io - All rights reserved.