Replies: 5 comments 9 replies
-
I would guess this is because it thinks there is no |
Beta Was this translation helpful? Give feedback.
-
Not sure if you still need this, but if you're using TypeScript, you can do something like this in a declaration file: declare function route(name: string, params?: any): string; If you have TypeScript configured, PHPStorm will pick up that declaration. Not sure if there's a better way. |
Beta Was this translation helpful? Give feedback.
-
It would be great if the creator of Ziggy (or another member of the community) could make a plugin for PhpStorm that gives declarative support for route() in Phpstorm so the program know that it is using a global route() function. @taylorotwell |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for your discussion. What have I to do exactly? I installed 1.6, added @routes to blade. |
Beta Was this translation helpful? Give feedback.
-
For anyone reading later on, another solution is to create a // utilities/route.js
import Router from 'ziggy-js/src/js/Router.js'
export function route(name, params, absolute, config) {
const router = new Router(name, params, absolute, config);
return name ? router.toString() : router;
} Then import the method in your Vue components (auto imports will work), or use global properties
|
Beta Was this translation helpful? Give feedback.
-
Ziggy version
1.0
Laravel version
9.19
Description
I've already have this problem for a while.
When I use
route()
in my Vue.js file, it is underlined. When I hover over it it says: Unresolved function or method route().I'm using the
@routes
on my app.blade.phpHow can I get rid of this underline?
Ziggy call and context
Ziggy configuration
Route definition
Beta Was this translation helpful? Give feedback.
All reactions