app/Http/Controllers/TodoController.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(Request $request)
    {
        $this->validate($request,[
            'title' => 'required'
        ]);
        $todo = new Todo;
        $todo->title = $request->title;
        $todo->save();
        return back();
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'title' => 'required' ] ) ; $ todo = new Todo ; $ todo -> title = $ request -> title ; $ todo -> save ( ) ; return back ( ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .