app/Http/Controllers/RdvsController.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)
    {
        $rdv = Rdv::create([
            'user_id'       => Auth::id(),
            'receiver_id'   => $request['receiver_id'],
            'date_propose'  => $request['date_propose'],
            'date_appouv'  => $request['date_propose'],
            'rdv_comment'   => $request['rdv_comment'],
            'statut_rdv'    => 0
        ]);
        if($rdv){
            $meeting = Meeting::create([
                'heureMeet'         => $request['heureMeet'],
                'heureFinMeet'      => $request['heureFinMeet'],
                'dateMeet'          => $request['date_propose'],
                'statutMeet'        => 0
            ]);
            if($meeting){
                $particite = ParticipeMeeting::create([
                    'user_id'   => Auth::id(),
                    'meeting_id'    => $meeting->id
                ]);
                return redirect()->route('rdv.index');
            }
        }
    }
public function store ( Request $ request ) { $ rdv = Rdv :: create ( [ 'user_id' => Auth :: id ( ) , 'receiver_id' => $ request [ 'receiver_id' ] , 'date_propose' => $ request [ 'date_propose' ] , 'date_appouv' => $ request [ 'date_propose' ] , 'rdv_comment' => $ request [ 'rdv_comment' ] , 'statut_rdv' => 0 ] ) ; if ( $ rdv ) { $ meeting = Meeting :: create ( [ 'heureMeet' => $ request [ 'heureMeet' ] , 'heureFinMeet' => $ request [ 'heureFinMeet' ] , 'dateMeet' => $ request [ 'date_propose' ] , 'statutMeet' => 0 ] ) ; if ( $ meeting ) { $ particite = ParticipeMeeting :: create ( [ 'user_id' => Auth :: id ( ) , 'meeting_id' => $ meeting -> id ] ) ; return redirect ( ) -> route ( 'rdv.index' ) ; } } }
Store a newly created resource in storage.
Store a newly created resource in storage .