In my app I have a users table and a user_profiles table. When creating a new user I need to fill the new users ID in the user_profile table.
Here is my store function in my users controller
public function store()
{
$userData = new User(Input::only('username'));
$userProfileData = new UserProfile(Input::except('username'));
$userData->save();
$userProfileData->save();
Flash::success('A new user has been created successfully.');
return Redirect::route('users.index');
}
How can I pass the newly created users id to the users_id column in the users_profile table?