/** * Store a newly created resource in storage. * * @param Request $request * @return Response */ public function store(Request $request) { $service = new Service(); $service->fill($request->all()); $service->save(); return redirect()->route('services.show', $service); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(ServiceRequest $request) { $service = new Service(); $service->fill($request->all()); $service->section = str_replace('services.', '', $request->section); $service->save(); return redirect(route($request->section))->with('message', 'Servicio creado corectamente'); }
public function update(Request $request, Service $service) { $insert = $service->fill($request->input())->save(); if ($insert) { return 0; } else { return 1; } }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(Service $service, Request $request) { // $data = $request->all(); $data['created_by'] = \Auth::user()->id; $data['updated_by'] = \Auth::user()->id; $data['is_active'] = 1; $data['company_id'] = 1; $service->fill($data)->save(); return Redirect::route('services.index'); }