-
Notifications
You must be signed in to change notification settings - Fork 255
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
Routes Blade Directive not being recognized #115
Comments
Laravel 5.5.27 |
Does |
No, it's the same in either case. It simply puts |
It looks like if I make a change in ZiggyServiceProvider it works. I replaced: |
No for me with |
same as me |
It is working fine on:
|
Not working on: Displays @routes just as text. |
Someone can please create a repo with minimal reproduction. |
@ankurk91 I have figured out that in my case the package lab404/laravel-impersonate is the problem. I have made a minimal reproduction https://github.com/fridzema/ziggy-issue |
@fridzema
The |
@ankurk91 uuuhmm i had to do manually php artisan view:clear to see te results |
@fridzema |
@ankurk91 Thanks! i'll just wait for the release. |
What is the issue with laravel-impersonate? I'm not using this package but many others. I need to know what to look for. |
@rorymcdaniel |
@ankurk91 Composer show
|
@ankurk91 I'm not using laravel-impersonate and also experience this issue. Currently on Laravel 5.5.26 & Ziggy 0.6.0 |
What i have done to figure out which package is causing the issue is clone an empty laravel project (you can use https://github.com/fridzema/ziggy-issue) and just pasted all dependencies in composer.json. Then run Maybe not the best way but it was good enough for me to quickly find the problem. |
Signed-off-by: Benjamin Michotte <[email protected]>
@gwleuverink Can you post your composer.json? |
We are closing this issue because it appears to be related to a package conflict. Please update your packages and if you are able to identify other conflicting packages, point their maintainers to this thread: 404labfr/laravel-impersonate#25 |
@DanielCoulbourne No, I think it isn't a package conflict. I've got the same problem too and have no other weird packages installed. |
Can you post your |
Totally stripped down my composer file and the error still exists...
|
@DanielCoulbourne Sorry for some reason missed your mention. Tough the issue is closed these were my dependencies of that point in time.
From the top of my head laratrust is the only package that also registers bade directives. I'll strip that out and post my findings here. |
Hi @jakebathman. I just updated all packages and cleared the views. Whatever the culprit was, it's fixed now. Still peculiar that removing and reinstalling packages individually didn't work earlier today. I probably missed something. All is working now. Thanks for the great package and the support! |
PHP v7.1.14 Same issue: @routes is rendered as string after version update. I was on v0.5.0 and there is no issue (now I am back to v0.5.0). I am not using impersonate package. |
@kikky7 can you post your |
|
I've just fixed this issue with some code modification on ServiceProvider I modified the code below (boot method) into $this->app['blade.compiler']->directive('routes', function ($group) {
return "<?php echo app('" . BladeRouteGenerator::class . "')->generate({$group}); ?>";
}); I'm not sure this modification is right solution, but in my case, this helped me getting out of this strange bug. P.S. |
Thanks for the help figuring this out, folks. If anyone continues having issues that might trace back to Ziggy, please open a new issue. |
Thanks @darron1217 that works for me. |
Well... that's a good news @darron1217. The issue toke use forever to solve. Thanks for sharing the solution with us and we will be waiting for your PR. 😀 |
I created PR :) |
I used tightenco/ziggy 0.6.2. I replaced: |
For some reason I've just come across the same issue, even though I am using the latest version of the package. Laravel 5.4, PHP 7.1.5. Works in my dev environment but not in prod. I'll look deeper into it, but in the meantime here is a quick fix: simply replace the |
My problem was that there was a space at the end of |
this works for me
|
Hello there, I'm not able to use it on laravel 5.6 using ziggy's version 8.1. Route is not defined. Fun fact, this error only shows on my server (amazon aws ec2). Can you help me please? |
Hello, If you are in production, do you use cache for configuration, ... with I had the same issue yesterday, on my machine it worked like a charm, both on For me, the solution was to update my deployment script from: ...
php artisan optimize
... to:
|
Laravel 10. Ziggy 1.6 same issue.
|
I'm using Laravel 5.5.28 and have tightenco/ziggy 0.6.0 installed. Console output shows that tightenco/ziggy was in fact discovered.
I've placed @routes in my base layout blade template, but it's not being rendered. Looking at the source simply shows @routes there instead of the JavaScript output I would expect.
Am I missing something obvious? What's the best way to troubleshoot this?
The text was updated successfully, but these errors were encountered: