app/Http/Controllers/TripController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Trip  $trip
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Trip $trip)
    {
        $this->validate($request, [
            'trip' => 'required',
            'tarif' => 'required'
        ]);
        Trip::where('id', '=', $trip->id)->update([
            'trip' => $request->trip,
            'tarif' => $request->tarif
        ]);
        return redirect()->route('trip.index');
    }
public function update ( Request $ request , Trip $ trip ) { $ this -> validate ( $ request , [ 'trip' => 'required' , 'tarif' => 'required' ] ) ; Trip :: where ( 'id' , '=' , $ trip -> id ) -> update ( [ 'trip' => $ request -> trip , 'tarif' => $ request -> tarif ] ) ; return redirect ( ) -> route ( 'trip.index' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .