app/Http/Controllers/TaskController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(TaskRequest $request)
    {
        $task = new Task();
        $task->fill($request->all());
        $task->user_id = Auth::user()->id;
        $task->registration_date = date('Y-m-d');
        $task->save();
        return redirect()->route('tasks.show', $task)->with('flash', '作成しました');
    }
public function store ( TaskRequest $ request ) { $ task = new Task ( ) ; $ task -> fill ( $ request -> all ( ) ) ; $ task -> user_id = Auth :: user ( ) -> id ; $ task -> registration_date = date ( 'Y-m-d' ) ; $ task -> save ( ) ; return redirect ( ) -> route ( 'tasks.show' , $ task ) -> with ( 'flash' , '作成しました'); }
Store a newly created resource in storage.
Store a newly created resource in storage .