Try print_r($input) after Institution::create($input);
If you are going to add only admin_id on institution table, why do you pass whole $input.
Can you show us your models?
I'm assuming this is because admin_id isn't mass assignable, which being an ID you don't really want, so you can do it this way to get around the mass assignment problem.
$institution = new Institution;
$institution->fill(Input::all());
$user->institution()->save($institution); // Automagically associated the $institution with $user using Laravels relationships
or alternativly
$institution = new Institution;
$institution->fill(Input::all());
$institution->admin_id = $user->id;
$institution->save();
iWader said:
Can you show us your models?
I'm assuming this is because admin_id isn't mass assignable, which being an ID you don't really want, so you can do it this way to get around the mass assignment problem.
$institution = new Institution; $institution->fill(Input::all()); $user->institution()->save($institution); // Automagically associated the $institution with $user using Laravels relationships
or alternativly
$institution = new Institution; $institution->fill(Input::all()); $institution->admin_id = $user->id; $institution->save();
That perfect! Thank you
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community