MrJuliuss / syntara

Admin package for Laravel 4.
MIT License
302 stars 77 forks source link

Redirect to different routes for different user level. #168

Open sithuaung opened 9 years ago

sithuaung commented 9 years ago

Hi @MrJuliuss

I need a way to redirect to different routes for different user level. I've already looked at postLogin method located in MrJuliuss\Syntara\Controllers\DashboardController.

if I add some line before the return true statment, login function doesn't work anymore.

How can I accomplish this?

sithuaung commented 9 years ago

Dear @MrJuliuss

I found that postLogin method just returned true and it returned as json. Where did you handle the redirect action after login is successful?

Regards Sithu

MrJuliuss commented 9 years ago

Hi, when the user is logged in, you just need to redirect to the same url (/dashboard/login), and the user will be redirect to the url he was looking for. ;)

sithuaung commented 9 years ago

Hi @MrJuliuss

the thing is I want them to redirect to their own view and navigation. eg. if they're HR, they will be redirected to HR page with HR actions. if they're Admin, they will be redirected to Admin page with Admin actions.

I have different navigation and actions for these users level. So I want them to redirect to their pages, as soon as they login which means I don't have the url he/she was looking for.

MrJuliuss commented 9 years ago

Hi @webcrazy, i have no solution for the moment. Maybe, you can find a solution at the side of the filters file. And manage it in a config file.

sithuaung commented 9 years ago

Hi @MrJuliuss Thanks for your reply.But I didn't know how to do it. So I had to handle on my own.