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

@elseguest directive seems doesn't work #33204

Closed
JonMagon opened this issue Jun 13, 2020 · 2 comments
Closed

@elseguest directive seems doesn't work #33204

JonMagon opened this issue Jun 13, 2020 · 2 comments

Comments

@JonMagon
Copy link

  • Laravel Version: 7.13.0
  • PHP Version: 7.4.3

Description:

When a user is logged he can't see a part between @elseguest and @endguest directives.
In the compiled blade there's just the same condition in both ifs.

<?php if(auth()->guard()->guest()): ?>
    <div>first</div>
<?php elseif(auth()->guard()->guest()): ?>
    <div>second</div>
<?php endif; ?>

Steps To Reproduce:

  • Use the following construction:
@guest
    <div>first</div>
@elseguest
    <div>second</div>
@endguest
@X-Coder264
Copy link
Contributor

The compiled Blade PHP looks as expected. Check this PR (and the tests in it) for more info:

#23569

@JonMagon
Copy link
Author

Thanks, it makes sense. else confuses me here

@JonMagon JonMagon changed the title @elseguest directive doesn't work @elseguest directive seems doesn't work Jun 15, 2020
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

2 participants