I am trying to figure out how to verify that a registered user in Laravel 4 can visit the correct user account.
At the moment, this is what is in the routes.php file.
Route::get('user/{id}', array('before' => 'auth', function(){
How can I limit this so that user / 1 can only see the profile if this is the current user ID in the system?
Auth::user()->id
It returns the input identifier for validation, but I cannot figure out how to write a filter that validates it at {id} in the URL.
Please, help! Thanks.
source share