app/Http/Controllers/Basique/PubsController.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)
    {
        $achatpack = AcheterPack::create([
            'user_id'           => Auth::id(),
            'pack_id'           => $request['pack_id'],
            'date_achat'        => $request['date_achat'],
            'date_fin'          => $request['date_fin'],
            'statut_pack'       => 0
        ]);
        if($achatpack){
            return redirect()->route('pubs.index');
        }
    }
public function store ( Request $ request ) { $ achatpack = AcheterPack :: create ( [ 'user_id' => Auth :: id ( ) , 'pack_id' => $ request [ 'pack_id' ] , 'date_achat' => $ request [ 'date_achat' ] , 'date_fin' => $ request [ 'date_fin' ] , 'statut_pack' => 0 ] ) ; if ( $ achatpack ) { return redirect ( ) -> route ( 'pubs.index' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .