Ben
Header action on section to go back on a specific step on a Wizard Form
Hey, thanks for your solution! 🙂 I didn't know you can use your own view for an Action like that, cool! Maybe that's a solution for a problem of mine... https://discord.com/channels/883083792112300104/1235970269483499520
10 replies
Custom Save Button for Create/Edit with Disable on FileUpload
Alternatively, it would help me if I knew how to manipulate the data when clicking on the standard create/save action, but it must be considered that I want to include these buttons twice, once with changing 'active' to true and once without.
I also found out that in the template, it checks if it is a submit button, and these buttons receive an indicator when a file upload is in progress.
vendor/filament/support/resources/views/components/button/index.blade.php
$hasFormProcessingLoadingIndicator = $type === 'submit' && filled($form);
6 replies
Header action on section to go back on a specific step on a Wizard Form
On my last page in a wizard i have a summary to verify before submitting. I used a placeholder with Html Content. In the Placeholder i'm doing something like this: <span x-on:click="step='name-of-the-wizard-step'">Back to the Step</span> and that works. But i'm not sure how to do emit this from an action.
I found an old filament v2 example for a table view, maybe it works like this: https://v2.filamentphp.com/tricks/emit-event-from-table-actions
10 replies
How to Warn Users of Unsaved Changes on the TenantProfile Page?
Okay folks, as far as I understand, the "Unsaved Changes Alert" feature has not yet been implemented in the files for editing the Tenant Profile. I don't feel confident enough as a developer to submit a pull request yet, but I'd like to share my solution approach.
I got it working in the following way:
In my
EditCompanyProfile
file (which extends EditTenantProfile
), I added use HasUnsavedDataChangesAlert;
(\Filament\Pages\Concerns\HasUnsavedDataChangesAlert
).
Then, I looked at the template set in EditTenantProfile, copied it, and customized it with my own:
protected static string $view = 'filament.pages.tenancy.edit-tenant-profile';
At the end, I inserted this: <x-filament-panels::page.unsaved-data-changes-alert />
before the </x-filament-panels::page>
.
After that, it worked.4 replies
Multi tenancy - Select relationship() - Searchable() remove tenant information when clicked
From the docs:
Form component and filter scoping. When using the Select, CheckboxList or Repeater form components, the SelectFilter, or any other similar Filament component which is able to automatically fetch "options" or other data from the database (usually using a relationship() method), this data is not scoped. The main reason for this is that these features often don't belong to the Filament Panel Builder package, and have no knowledge that they are being used within that context, and that a tenant even exists. And even if they did have access to the tenant, there is nowhere for the tenant relationship configuration to live. To scope these components, you need to pass in a query function that scopes the query to the current tenant.
use Filament\Facades\Filament;
use Filament\Forms\Components\Select;
use Illuminate\Database\Eloquent\Builder;
Select::make('author_id')
->relationship(
name: 'author',
titleAttribute: 'name',
modifyQueryUsing: fn (Builder $query) => $query->whereBelongsTo(Filament::getTenant())),
);
5 replies