Replies: 1 comment
-
Mixins don't work with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am using Laravel 9, Vite and Vue for one of my projects.
What I want to do is protect and hide certain/most admin routes from guests. Mainly because I feel like it's unsecure but also because I don't like to clutter the routes list with hunderds of admin routes when unauthenticated.
Now what you can do is:
Create the
config/ziggy.php
file and for example use this.ziggy.php
in your
app.blade.php
Now this works as intended, but you need a page reload for it to properly work.
My idea was to remove the
@routes
from theapp.blade.php
.I added the following in vite.config.js
Now in
app.js
andssr.js
I addedNow on the homepage this works perfectly fine, when I'm not authenticated, The following routes work.
Routes that don't work: ( as intended )
However, as soon I switch pages and click on the login button or manually go to the
admin.login
route.When submitting the form I get the error.
This is because it's inside the
<script setup>
In the ` part it works fine.
Is there any fix for this or perhaps a better solution for this ?
Beta Was this translation helpful? Give feedback.
All reactions