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

Add @auth blade component #20087

Merged
merged 5 commits into from Jul 17, 2017

Conversation

Projects
None yet
3 participants
@m1guelpf
Contributor

m1guelpf commented Jul 15, 2017

I find myself writing @if(Auth::check()) in blade lots of times. This Pull Request adds a @auth blade directive to simplify this.

m1guelpf added some commits Jul 15, 2017

cs
@taylorotwell

This comment has been minimized.

Show comment
Hide comment
@taylorotwell

taylorotwell Jul 16, 2017

Member

I shouldn't be able to do @auth(api)... it should be @auth('api')

Member

taylorotwell commented Jul 16, 2017

I shouldn't be able to do @auth(api)... it should be @auth('api')

@taylorotwell taylorotwell merged commit 6ce2f5a into laravel:5.4 Jul 17, 2017

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/styleci/pr The StyleCI analysis has passed
Details

@m1guelpf m1guelpf deleted the m1guelpf:auth-blade branch Jul 17, 2017

@akoury

This comment has been minimized.

Show comment
Hide comment
@akoury

akoury Sep 5, 2017

@taylorotwell @themsaid do you like the idea of having, for example, @auth($comments->count() > 1), in a way that works like an @if(Auth::check() && $posts->count() > 1) in a single command?, I know the parameter is currently a string for a guard, so we could check if it is not a string, then add the parameter as a second check

akoury commented Sep 5, 2017

@taylorotwell @themsaid do you like the idea of having, for example, @auth($comments->count() > 1), in a way that works like an @if(Auth::check() && $posts->count() > 1) in a single command?, I know the parameter is currently a string for a guard, so we could check if it is not a string, then add the parameter as a second check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment