app/Http/Controllers/TransactionController.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, [
            'driver_id' => 'required',
            'vehicle_id' => 'required',
            'jenis_material' => 'required',
            'asal' => 'required',
            'tujuan' => 'required',
            'muatan' => 'required',
            'trip' => 'required'
        ]);
        Transaction::create([
            'driver_id' => $request->driver_id,
            'vehicle_id' => $request->vehicle_id,
            'jenis_material' => $request->jenis_material,
            'asal' => $request->asal,
            'tujuan' => $request->tujuan,
            'muatan' => $request->muatan,
            'trip' => $request->trip
        ]);
        return redirect()->route('transaction.index');
    }
public function store ( Request $ request ) { $ this -> validate ( $ request , [ 'driver_id' => 'required' , 'vehicle_id' => 'required' , 'jenis_material' => 'required' , 'asal' => 'required' , 'tujuan' => 'required' , 'muatan' => 'required' , 'trip' => 'required' ] ) ; Transaction :: create ( [ 'driver_id' => $ request -> driver_id , 'vehicle_id' => $ request -> vehicle_id , 'jenis_material' => $ request -> jenis_material , 'asal' => $ request -> asal , 'tujuan' => $ request -> tujuan , 'muatan' => $ request -> muatan , 'trip' => $ request -> trip ] ) ; return redirect ( ) -> route ( 'transaction.index' ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// dd($request->vehicle_id);