1
konnte ich nicht finden Ich habe versucht, einen Benutzer mit einem Profil zu verbinden. Hier ist mein Code:Laravel CRUD ORM Modell
Profil Modell:
class Profile extends Model
{
public function user(){
return $this->belongsTo('App\User');
}
}
Benutzermodell:
class User extends Authenticatable
{
...
public function profile(){
return $this->hasOne('App/Profile');
}
}
Profile:
public function show($username)
{
$user = User::where('username',$username)->first();
$profile = $user->profile;
return view('profiles.show')->withProfile($profile);
}
Strecke (Es soll "profil" sein):
Route::resource('profil','ProfileController');
Fehler: http://prntscr.com/ff6y0a
Irgendwelche Tipps auf den Rest der CRUD-Funktionalität zu tun ist sehr willkommen!