vendredi 24 août 2018

Put javascript alert in Laravel model - Not able to alert message from Laravel Model

I want to alert a invalid message to the user from Laravel Model, I wrote the code but its not alerting. This piece of code works perfectly in simple PHP with wamp but this does not work with Laravel Model.

I Know this can be done using Ajax response and show the message in actual JS file instead of Model/Controller file but I want to know if there is a way to alert a JavaScript from Model itself instead of again AJAX call.

following is the function in my Model PHP where I am trying to alert a message:

public static function Login_Authenticator($request)
{
    if($ldapconn)
    {
        $ldapbind = @ldap_bind($ldapconn, $ldapuser, $ldappass) or  die("<script>alert('Invalid Credentials');</script>");
    }

}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire