Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gate helper #31

Closed
ghost opened this issue Sep 22, 2016 · 2 comments
Closed

Gate helper #31

ghost opened this issue Sep 22, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 22, 2016

From your site:

Using the Gate helper
All permissions are automatically defined inside Laravel's Gate helper.
Gate::allows('create.posts');
@can('create.posts');
$user->can('create.posts');

I cannot get this to work.
So, while this return TRUE:
$user->hasPermissionTo('users.write');
This return FALSE:
\Gate::allows('users.write');

@ghost
Copy link
Author

ghost commented Sep 26, 2016

Changing the order of providers in config/app.php fixed the issue.

@kfeng0806
Copy link

@Yochanan Can you please explain how did you get fix this?
I did with

Gate::allows
@can
$user->can

no one get working, maybe any tips?

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant