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