/** * Store a newly created resource in storage. * * @return Response */ public function store() { $input = Request::all(); $avto = new Avto($input); $repair = new Repair($input); $customer = new Customer($input); $avto->save(); $repair->save(); $customer->save(); $order = new Order(['date' => $input['date'], 'd_avto' => $avto->id, 'd_r' => $repair->id, 'customer_id' => $customer->id]); $order->save(); // dd($avto);<--Для дебага return redirect('orders/ordersuccess'); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ public function create(array $data) { Customer::create(['fio' => $data['fio']]); Avto::create(['avto_name' => $data['avto_name'], 'color' => $data['color'], 'year' => $data['year']]); return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }