app/Http/Controllers/PostsController.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',
            'post' => 'required'
        ]);
        Post::create([
            'title' => request('title'),
            'post' => request('post'),
        ]);
        return redirect('/');
    }
public function store ( Request $ request ) { $ this -> validate ( request ( ) , [ 'title' => 'required' , 'post' => 'required' ] ) ; Post :: create ( [ 'title' => request ( 'title' ) , 'post' => request ( 'post' ) , ] ) ; return redirect ( '/' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .