undefined parmeter
Please I created a custom page and I redirect the user to the url of that page via and action
/**
Tables\Actions\ActionGroup::make([
Tables\Actions\Action::make('A4(x4)')
->url(fn (): string => route('filament.app.resources.delivery-notes.print-labels', ['number' => $number])),
Tables\Actions\Action::make('A4(x6)'),
Tables\Actions\Action::make('A4(x8)'),
])
*/
but in the view of that page , the number parameter is Undefined
10 Replies
how do you define route?
lik this
'print-labels' => Pages\printLabels::route('/labels/{number}'),
what you have in the mount method then?
this is the page clss
<?php
namespace App\Filament\Resources\DeliveryNoteResource\Pages;
use App\Filament\Resources\DeliveryNoteResource;
use Filament\Resources\Pages\Page;
class printLabels extends Page
{
protected static string $resource = DeliveryNoteResource::class;
protected static string $view = 'filament.resources.delivery-note-resource.pages.print-labels';
}
route model binding needs mount method
check the livewire docs for this
i think filament docs also has mentioned it
otherwise your component doesn't know anything about
$number
I'm new to livewire , I don't know houw
how
and what I supposed to looking for
it's a laravel thing not livewire
and it's called route model binding
Laravel
Components | Laravel
A full-stack framework for Laravel that takes the pain out of building dynamic UIs.
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
['number' => $number]
what is $number? The record?