app/Http/Controllers/BookingsController.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)
    {
        Validator::make($request->all(), [
            'to' => 'required|different:from',
        ])->validate();
         $Booking = new Booking();
         $Booking->Fname = request('Fname');
         $Booking->Lname = request('Lname');
         $Booking->email = request('email');
         $Booking->age = request('age');
         $Booking->number = request('number');
         $Booking->gender = request('gender');
         $Booking->country = request('country');
         $Booking->state = request('state');
         $Booking->zip = request('zip');
         $Booking->to = request('to');
         $Booking->from = request('from');
         $Booking->DeptDate = request('DeptDate');
         $Booking->DeptTime = request('DeptTime');
         $Booking->Class = request('Class');
         $Booking->tickets = request('tickets');
         $Booking->childrens = request('childrens');
         $Booking->cost = request('cost');
         $Booking->payment = request('payment');
         $Booking->user_id = auth()->user()->id;
         $Booking->save();
         $details=[
            'title'=>'Mail title',
            'body'=>'Mail body'
        ];
          return view('bookings.submit')->with('Booking', $Booking);
    }
public function store ( Request $ request ) { Validator :: make ( $ request -> all ( ) , [ 'to' => 'required|different:from' , ] ) -> validate ( ) ; $ Booking = new Booking ( ) ; $ Booking -> Fname = request ( 'Fname' ) ; $ Booking -> Lname = request ( 'Lname' ) ; $ Booking -> email = request ( 'email' ) ; $ Booking -> age = request ( 'age' ) ; $ Booking -> number = request ( 'number' ) ; $ Booking -> gender = request ( 'gender' ) ; $ Booking -> country = request ( 'country' ) ; $ Booking -> state = request ( 'state' ) ; $ Booking -> zip = request ( 'zip' ) ; $ Booking -> to = request ( 'to' ) ; $ Booking -> from = request ( 'from' ) ; $ Booking -> DeptDate = request ( 'DeptDate' ) ; $ Booking -> DeptTime = request ( 'DeptTime' ) ; $ Booking -> Class = request ( 'Class' ) ; $ Booking -> tickets = request ( 'tickets' ) ; $ Booking -> childrens = request ( 'childrens' ) ; $ Booking -> cost = request ( 'cost' ) ; $ Booking -> payment = request ( 'payment' ) ; $ Booking -> user_id = auth ( ) -> user ( ) -> id ; $ Booking -> save ( ) ; $ details = [ 'title' => 'Mail title' , 'body' => 'Mail body' ] ; return view ( 'bookings.submit' ) -> with ( 'Booking' , $ Booking ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .
// Mail::to("matepranay@gmail.com")->send(new Mails($details));