jeudi 9 juin 2016

Connecting to Laravel application via a core php application for admin login

I have a core php application, which have two types of users basically. Normal users and Admin users. Since both are seperate functionalities, i am planing to apply laravel framework only to admin section now. But not understanding how to establish connection once the user logs in.

The scenario is this: User enters his login credentials-> If normal user, proceeds with core php codes. If Admin user->then it should transfer to laravel application.

Below is my ajax call in login page, any help please.

$.ajax({
type : "POST",
url : "<?php echo url();?>/login/validate_login",
data : {username: username,password:password},
dataType : "JSON",
success : function(response) {
        if(response.status=='failure')
        {                               
            ///failure code             
        }
        else if(response.status=='normal_user')
        {                               
            window.location.href = "home.php";  
        }

                    else if(response.status=='admin_user')
        {                               
            window.location.href = --------------------//what to give here
            // laravel application is in /var/www/html/laravel_app path
            // have to link to adminuser Controller in the laravel_app,
            // which then takes him to the admin home page and proceeds.
        }

}

});



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire