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