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