Why not scrap the user id in the route and pull it out of the Auth?
kpzani said:
Why not scrap the user id in the route and pull it out of the Auth?
Hey kpzani, thanks for your response.
I realise I haven't fully elaborated on this option - If using routes, I would compare the ID of the current logged in user (Sentry::getUser()->id) against the user_id of that particular todo list (todo_lists.user_id). If the id of the logged in user does not match the user_id of the todo list, they would be redirected.
So I think I am pulling the user ID as you suggested, but from Sentry instead of Auth.
I hope that makes sense!
Tom
You need global scope for this, not the query scopes. That culttt rather not the way to go.
Here you'll find how to implement that scope: http://laravel.io/forum/07-24-2014-automatically-append-query-to-model#reply-11122
jarektkaczyk said:
You need global scope for this, not the query scopes. That culttt rather not the way to go.
Here you'll find how to implement that scope: http://laravel.io/forum/07-24-2014-automatically-append-query-to-model#reply-11122
Great advice, thanks! I'll follow up on global scopes :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community