app/Http/Controllers/InvitationsController.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)
    {
        $invitation = Invitation::create([
            'structure_id'      => $request->input('structure_id'),
            'salon_id'      => $request->input('salon_id'),
            'date_invit'      => date('y-m-d'),
            'motif_invit'   => 1
        ]);
        if($invitation){
            Message::create([
                'meeting_id'        => 0,
                'salon_id'          => $request->input('salon_id'),
                'user_id'           => Auth::id(),
                'date_message'      => now(),
                'statut_mess'       => -1,
                'content_mess'      => ' '
            ]);
            return redirect()->route("salons.show", $request->input('salon_id'));
        }
    }
public function store ( Request $ request ) { $ invitation = Invitation :: create ( [ 'structure_id' => $ request -> input ( 'structure_id' ) , 'salon_id' => $ request -> input ( 'salon_id' ) , 'date_invit' => date ( 'y-m-d' ) , 'motif_invit' => 1 ] ) ; if ( $ invitation ) { Message :: create ( [ 'meeting_id' => 0 , 'salon_id' => $ request -> input ( 'salon_id' ) , 'user_id' => Auth :: id ( ) , 'date_message' => now ( ) , 'statut_mess' => - 1 , 'content_mess' => ' ' ] ) ; return redirect ( ) -> route ( " salons.show " , $ request -> input ( 'salon_id' ) ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .