I have an AngularJS(front-end) and Laravel(back-end) app and I use JWT tokens for authentication. My objective is that when I log in, if the user is an admin, it will use a service that sends a request to the API(laravel backend) that returns a blade template(back-office of admin) that overrides the whole page. Is it possible?
I'm doing this because my Laravel back-end will serve as an API for many front-office apps in the future, and that's why I don't implement the back-office for the admin in AngularJS.
Here is my service in AngularJS:
redirectAdmin: function(){
return $http.get(appConfig.API_URL+'/admin');
},
Here is my route in Laravel:
Route::get('/admin', function(){
return view('admin');
});
I'm not really sure of what kind of information to put here, so if you need anything let me know.