Bryan
Bryan
FFilament
Created by Bryan on 4/17/2024 in #❓┊help
Is it possible to render a relation manager in a tenant profile page?
I want to render a relation on a tenant profile page, is this possible?
5 replies
FFilament
Created by Bryan on 1/9/2024 in #❓┊help
Page refresh when header action is clicked
Hi, is it possible to refresh a page when a header action is being clicked? I tried this so far:
protected $listeners = [
'refreshQuotationRequest' => '$refresh'
];

Actions\Action::make('create-concept-quotation')
->label('Maak concept offerte')
->icon('heroicon-o-document-arrow-up')
->color('info')
->form(
fn (Form $form) => $form->schema([
Select::make('product')
->required()
->label('Product')
->options(fn (WeFactService $weFactService) => $weFactService->allProducts()),
Checkbox::make('sent_mail_directly')
->label('Direct een mail versturen?'),
])
)
->action(function (array $data) {
$chain = [
new AddQuotationToWeFact(
quotationRequestId: $this->record->id,
payload: new ConceptQuotationPayload(strval($data['product']))
),
];

if ($data['sent_mail_directly']) {
$chain[] = new SendQuotationMailFromWeFact(
quotationRequestId: $this->record->id,
);
}

Bus::chain($chain)->dispatch();

Notification::make()
->title('Er wordt een concept offerte aangemaakt in WeFact, dit kan enkele minuten duren.')
->success()
->persistent()
->send();

$this->dispatch('refreshQuotationRequest');
})
->hidden(fn () => $this->record->status !== QuotationRequestStatus::PENDING),
protected $listeners = [
'refreshQuotationRequest' => '$refresh'
];

Actions\Action::make('create-concept-quotation')
->label('Maak concept offerte')
->icon('heroicon-o-document-arrow-up')
->color('info')
->form(
fn (Form $form) => $form->schema([
Select::make('product')
->required()
->label('Product')
->options(fn (WeFactService $weFactService) => $weFactService->allProducts()),
Checkbox::make('sent_mail_directly')
->label('Direct een mail versturen?'),
])
)
->action(function (array $data) {
$chain = [
new AddQuotationToWeFact(
quotationRequestId: $this->record->id,
payload: new ConceptQuotationPayload(strval($data['product']))
),
];

if ($data['sent_mail_directly']) {
$chain[] = new SendQuotationMailFromWeFact(
quotationRequestId: $this->record->id,
);
}

Bus::chain($chain)->dispatch();

Notification::make()
->title('Er wordt een concept offerte aangemaakt in WeFact, dit kan enkele minuten duren.')
->success()
->persistent()
->send();

$this->dispatch('refreshQuotationRequest');
})
->hidden(fn () => $this->record->status !== QuotationRequestStatus::PENDING),
7 replies
FFilament
Created by Bryan on 10/26/2023 in #❓┊help
FileUpload download/preview file from private storage
Hi, is it possible to simply download a file from private storage? I've tried this, but this doesn't preview or download it correctly.
FileUpload::make('images')
->preserveFilenames()
->multiple()
->image()
->disk('local')
->visibility('private')
->directory(fn (?Application $application) => $application?->id)
->enableOpen()
->enableDownload()
FileUpload::make('images')
->preserveFilenames()
->multiple()
->image()
->disk('local')
->visibility('private')
->directory(fn (?Application $application) => $application?->id)
->enableOpen()
->enableDownload()
2 replies
FFilament
Created by Bryan on 10/25/2023 in #❓┊help
Wait for relationship to be created in form
Hi, I am trying to save/fill relationships in a form. My question is, is it possible to wait for a relationship to be created, to then create another relationship which depends on that first relationship?
3 replies
FFilament
Created by Bryan on 10/6/2023 in #❓┊help
Redirect to livewire component doesnt trigger error
I am trying to redirect to a livewire component, but the error is not being shown. I fill the error based on a ErrorMessage livewire component This is what I am trying to do in the mount() of my OrderForm
if (Route::getRoutes()->match(Request::create(request()->session()->previousUrl()))->getName() === 'orders.confirmation') {
$this->dispatch(
event: 'error',
error: 'Er is iets misgegaan met de betaling. Probeer het later opnieuw.'
);
}
if (Route::getRoutes()->match(Request::create(request()->session()->previousUrl()))->getName() === 'orders.confirmation') {
$this->dispatch(
event: 'error',
error: 'Er is iets misgegaan met de betaling. Probeer het later opnieuw.'
);
}
Is this the right moment to do the dispatch?
3 replies
FFilament
Created by Bryan on 9/26/2023 in #❓┊help
Class "Filament\Forms\Components\TextArea" not found on production
When my application is deployed, I get the Class "Filament\Forms\Components\TextArea" not found on production. What can I do about this?
7 replies