PHP code example of laravel / wayfinder
1. Go to this page and download the library: Download laravel/wayfinder library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
laravel / wayfinder example snippets
Route::get('clients/{client}/payments', [ClientPaymentsController::class, 'index'])
->name('clients.payments.index');
Route::get('clients/{client}/payments-archive', [ClientPaymentsController::class, 'index'])
->name('clients.payments.archive');
Route::get('/exports/{report}', ExportController::class)
->name('exports.show');
Route::post('/exports/{report}', ExportController::class)
->middleware('throttle:5,1')
->name('exports.run');
php artisan wayfinder:generate
php artisan wayfinder:generate --path=resources/js/wayfinder
php artisan wayfinder:generate --skip-actions
php artisan wayfinder:generate --skip-routes
shell
php artisan route:clear
npm run build
shell
php artisan wayfinder:generate --with-form
tsx
import { store, update } from "@/actions/App/Http/Controllers/PostController";
const Page = () => (
<form {...store.form()}>
{/* <form action="/posts" method="post"> */}
{/* ... */}
</form>
);
const Page = () => (
<form {...update.form(1)}>
{/* <form action="/posts/1?_method=PATCH" method="post"> */}
{/* ... */}
</form>
);
tsx
import { store, update } from "@/actions/App/Http/Controllers/PostController";
const Page = () => (
<form {...update.form.put(1)}>
{/* <form action="/posts/1?_method=PUT" method="post"> */}
{/* ... */}
</form>
);