Daniel Reales
Listening for broadcast events multi-tenancy
Hi guys, I'm new to using broadcasting in Laravel and I'm testing Laravel Reverb. Right now, I have it working so that when a user registers an appointment, if another logged-in user is on the same team, their appointment panel is updated with the reservation. So far, so good. Each user has X associated stores. I actually need it so that if user A, who is associated with stores 1 and 2, registers an event, it updates user B who is also associated with stores 1 and 2.
Currently, it only works if both users are in the same store, but if they are in different stores, it doesn't update. What am I doing wrong?
This is my code:
//chanels.php:
//RefreshAppointmentsEvent.php:
//script for loading events:
3 replies
No refresh component
I have the following hook when starting the panel:
The modal opens and everything works correctly. In this modal, I have a form that also creates a record correctly, and I have two events, one to close the modal and another to call another component:
This call $this->dispatch('updateTicket'); does not work.
In the component where I want this event to be called, I have the following:
`
But it does nothing. In other parts of the application, I have the same functionality and it works correctly, but I do it through an action passing the Component $livewire, and from here, I emit the event.
Why might this be happening to me?
6 replies
HasFiltersForms not found
I can't found on Filamentphp v3: use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
https://filamentphp.com/docs/3.x/panels/dashboard#filtering-widget-data
7 replies
How to create a requiredIf condition in a relationship?
I would like to do this:
TextInput::make('price')
->requiredIf('store.type_tax', TaxType::Product->value)
->numeric()
->inputMode('decimal')
->step(0.01)
->label('Price')
->columnSpan(['md' => 6]),
How can I retrieve the 'type_tax' from the 'store' relationship and make this field required based on that value?2 replies
Error removing image from Custom Path Generator Media Library
I have this Custom Path Generator:
class CustomPathGenerator implements BasePathGenerator
{
/*
* Get the path for the given media, relative to the root storage path.
*/
public function getPath(Media $media): string
{
return match ($media->model_type) {
Store::class => Store::PATH_IMAGES . '/' . Filament::getTenant()->id . '/' . $media->getKey() . '/',
Catalogue::class => Catalogue::PATH_IMAGES . '/' . Filament::getTenant()->id . '/' . $media->getKey() . '/',
Category::class => Category::PATH_IMAGES . '/' . Filament::getTenant()->id . '/' . $media->getKey() . '/',
Subcategory::class => Subcategory::PATH_IMAGES . '/' . Filament::getTenant()->id . '/' . $media->getKey() . '/',
default => $media->getKey() . '/',
};
}
/*
* Get the path for conversions of the given media, relative to the root storage path.
*/
public function getPathForConversions(Media $media): string
{
return $this->getPath($media).'conversions/';
}
/*
* Get the path for responsive images of the given media, relative to the root storage path.
*/
public function getPathForResponsiveImages(Media $media): string
{
return $this->getPath($media).'responsive-images/';
}
}
It creates correctly the image but If I try to delete de image, not remove the image. Why?2 replies
How to show in a column from table sum from relationship
I have this:
Tables\Columns\TextColumn::make('order_items_sum_price')
->sum('orderItems', 'price')->money('eur')->sortable()->label('Precio Total')
But every orderItem has a column with amount.
I need to multiply the quantity by its price and in turn make the total sum. How could I do it?6 replies