Oumaima
two resources in one table widget
I have a table called postponed orders , I want to fetch the orders and leads where they hav the postponed_date equals to today .
the problem : How can I collect them in one table widget , (Note : Lead & Order are separated models )
2 replies
Filament button inside foreach
What I'm trying to do is foreach products from database , each product has a button which opens a modal
The problem is : when I click order in one product , all the products button spinns , and I don't want that .
I have tried to add an ID or something like that , but it does not work .
this is my code :
<div class="group bg-white shadow-sm rounded-xl p-4 mb-4">
...
<x-filament::button outlined class="grid mx-auto mt-3 mb-4 w-96" icon="heroicon-o-shopping-cart" wire:click="openModal" >
Order
</x-filament::button>
<x-filament::modal id="place-order" displayClasses='block'>
..
<x-filament::button icon="heroicon-o-shopping-cart" wire:click="order">
Order
</x-filament::button>
</x-filament::modal>
</div>
4 replies
RegistrationResponse
How can I change the redirection url after the registration , I want to display a custom page , not the login form , and this is the register method :
public function register(): ?registrationSuccess
{
try {
$this->rateLimit(2);
} catch (TooManyRequestsException $exception) {
Notification::make()
->title(__('filament-panels::pages/auth/register.notifications.throttled.title', [
'seconds' => $exception->secondsUntilAvailable,
'minutes' => ceil($exception->secondsUntilAvailable / 60),
]))
->body(array_key_exists('body', __('filament-panels::pages/auth/register.notifications.throttled') ?: []) ? __('filament-panels::pages/auth/register.notifications.throttled.body', [
'seconds' => $exception->secondsUntilAvailable,
'minutes' => ceil($exception->secondsUntilAvailable / 60),
]) : null)
->danger()
->send();
return null;
}
$data = $this->form->getState();
$role = Role::where('name' , 'Seller')->first();
$data['role_id'] = $role->id;
$user = $this->getUserModel()::create($data);
$user->assignRole('Seller');
app()->bind(
\Illuminate\Auth\Listeners\SendEmailVerificationNotification::class,
\Filament\Listeners\Auth\SendEmailVerificationNotification::class,
);
event(new Registered($user));
// Filament::auth()->login($user);
// session()->regenerate();
// return app(registrationSuccess::class);
}
3 replies
Database notification
I want to add the database notification icon in the top bar , I followed the docs : https://filamentphp.com/docs/3.x/notifications/database-notifications#overview , and when I arrived to the chapter where I should add :
@livewire('database-notifications')
, I didn't know where to put it , keep in mind I don't have the layout file in resources/views
, can someone help me please ?3 replies
use the same route in multiple panels
I have two panels Admin and seller , and I have a route called print labels :
return [
'index' => Pages\ListDeliveryNotes::route('/'),
'create' => Pages\CreateDeliveryNote::route('/create'),
'edit' => Pages\EditDeliveryNote::route('/{record}/edit'),
'view' => Pages\ViewdeliveryNote::route('/{record}'),
'print-labels' => Pages\printLabels::route('/labels/{number}/{record}')
I want to call this route print-labels in the resource , where the prefix of the route changed : or exemple , if I'm in admin panel should be admin/delivery-note/labels/..
and if I'm in the seller panel should be seller/delivery-note/labels/..
, how can I call it , ->url(fn (DeliveryNote $record): string => route('filament.app.resources.delivery-notes.print-labels', ['number' => 6 , 'record' => $record])),
2 replies
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
21 replies