/** * Store a newly created resource in storage. * * @param CreateApplicationRequest|Request $request * @return Response */ public function store(CreateApplicationRequest $request) { $application = new Application(); $application->fill($request->all()); $application->user_id = Auth::user()->id; $application->save(); return redirect()->back(); }
/** * Store a newly created resource in storage. * * @param CreateApplicationRequest $request * @return Response */ public function store(CreateApplicationRequest $request) { $application = new Application(); $application->fill($request->all()); $application->user_id = Auth::id(); $application->status = 'process'; $application->save(); $history = new History(); $history->status = $application->status; $history->message = trans('messages.application_sent_successfully'); $history->user_id = $application->user_id; $history->application_id = $application->id; $history->save(); $message = trans('messages.application_sent_successfully'); Flash::info($message); return redirect()->route('applications.show', $application); }