dimanche 26 mars 2017

Accessing Function Variable

    public function acceptpersonalvisitupdate(Request $request)
    {  $employeeinfo=$request->input('employeeinfo');
       $id=$request->input('id');
       $visitoremail=$request->input('visitoremail');
       $visitorname=$request->input('visitorname');
       $visitorphonenumber=$request->input('visitorphonenumber');
       $visitortype=$request->input('visitortype');
       $empname=$request->input('empname');
       $empdept=$request->input('empdept');
       $date=$request->input('date');
       $from=$request->input('from');
       $noofhours=$request->input('noofhours');


       Mail::send('mails.acceptedpersonalvisit',     
        ['visitorname'=>$visitorname,'visitorphonenumber'=>$visitorphonenumber,
                                              'visitoremail'=>$visitoremail,'id'=>$id,'visitortype'=>$visitortype,
                                              'empname'=>$empname,'empdept'=>$empdept,'date'=>$date,'from'=>$from,
                                              'noofhours'=>$noofhours,'employeeinfo'=>$employeeinfo],function($message)
   {
     $message->to($visitoremail,$visitorname))->subject('Personal Visit Request Accepted');
   });
   DB::update('update bookingtable set employeeinfo=?,staus="Approved" where id=?',[$employeeinfo,$id]);
   return Redirect::to('acceptedpersonalvisits')->with('success','Successfully Accepted Personal Book Request!!!');
}

In The Above Code i have a acceptpersonalvisitupdate post function.Its variables are those list of variables defined.From that variables i want to access $visitoremail and $visitorname in mail function.when i normally represent the variable it shows error as undefined variable $visitoremail.how to access that variable inside mail function.Any Help and suggestions are most welcome.Thank You.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire