app/Http/Controllers/CompaniesController.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([
            'name' => 'required',
            'description' => 'required',
            'price' => 'required'
        ]);
        Companies::create($request->all());
        return redirect()->route('companies.index')
            ->with('success', 'Companies Added successfully.');
    }
public function store ( Request $ request ) { $ request -> validate ( [ 'name' => 'required' , 'description' => 'required' , 'price' => 'required' ] ) ; Companies :: create ( $ request -> all ( ) ) ; return redirect ( ) -> route ( 'companies.index' ) -> with ( 'success' , 'Companies Added successfully.' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .