public function store(Request $request) { $idolo = new Idol($request->all()); $idolo->save(); return redirect()->back(); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); Idol::create(['user_id' => $user->id, 'idol_id' => $user->id]); return $user; }