app/Http/Controllers/GestionnaireController.php
/**
     * Check if the email is already taken.
     *
     * @param  Request  $request
     * @return Response
     */
Check if the email is already taken.
@param  Request  $request
@return Response
Check if the email is already taken . @param Request $request @return Response
public function exists(Request $request)
    {
        $data = $request->only("email");
        $email = $data['email'];
        $gestionnaire = Gestionnaire::where("email",$email)->first();
        if(empty($gestionnaire)){
            return response()->json(['status' => 200, 'message' => "success"]);
        }
        else{
            abort(403, "Not allowed");
        }
    }
public function exists ( Request $ request ) { $ data = $ request -> only ( " email " ) ; $ email = $ data [ 'email' ] ; $ gestionnaire = Gestionnaire :: where ( " email " , $ email ) -> first ( ) ; if ( empty ( $ gestionnaire ) ) { return response ( ) -> json ( [ 'status' => 200 , 'message' => " success " ] ) ; } else { abort ( 403 , " Not allowed " ) ; } }
Check if the email is already taken.
Check if the email is already taken .