vendredi 3 novembre 2017

if else statement running like what i need something went wrong in laravel

i have 2 button accept and reject
when i die dump request is coming fine with accept id 2 and reject id 3 but i try to add if statement its bring me only accept skip reject

here is my code

 $interview = Interview::find($request->id);
    $user = Currentuser::where('id', $interview->CompanyID)->first();
    if ($request->Status = '2') {


                 $data = []; // Empty array

                Mail::send('email.useracceptjob', $data, function($message) use ($user){

                    $message->to($user->Email)->subject('Your Job Accepted By user');

                });
             }
             elseif ($request->Status = '3') {


                 $data = []; // Empty array

                Mail::send('email.userrejectjob', $data, function($message) use ($user){

                    $message->to($user->Email)->subject('Your Job Rejected By user');

                });
             }
             else{
                return response()->json(['code' => 500]);
             }

do i doing something wrong? Help me Please



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire