wayfinder-development
Activates whenever referencing backend routes in frontend components. Use when importing from @/actions or @/routes, calling Laravel routes from TypeScript, or working with Wayfinder route functions.
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Activates whenever referencing backend routes in frontend components. Use when importing from @/actions or @/routes, calling Laravel routes from TypeScript, or working with Wayfinder route functions.
How to use
Zainstaluj skill wayfinder-development w swoim projekcie Claude/Copilot, dodając go do konfiguracji agenta lub katalogu umiejętności.
Po zmianach w trasach backendu uruchom komendę regeneracji: php artisan wayfinder:generate --no-interaction. Jeśli pracujesz z formularzami, dodaj flagę --with-form: php artisan wayfinder:generate --with-form --no-interaction.
W komponentach frontendowych importuj trasy używając ścieżek @/actions lub @/routes. Przykład: import { show, store } from '@/actions/App/Http/Controllers/PostController' lub import { show as postShow } from '@/routes/post'.
Używaj importowanych funkcji do generowania tras. Wywołaj show(1) aby otrzymać obiekt trasy z url i method, lub show.url(1) aby uzyskać sam URL. Dla konkretnych metod HTTP użyj show.get(1), store.post(), update.patch(1), destroy.delete(1).
Dodaj parametry zapytania poprzez opcję query: show(1, { query: { page: 1 } }) zwróci /posts/1?page=1. Dla formularzy HTML użyj store.form() aby otrzymać action i method.
W komponentach Inertia React wykorzystaj wygenerowane obiekty tras bezpośrednio w komponencie Form: <Form {...store.form()}>. Jeśli Vite plugin nie jest zainstalowany, skill automatycznie zasugeruje regenerację tras.