Gandalf
Gandalf
FFilament
Created by Gandalf on 12/6/2024 in #❓┊help
Show a Step Wizard for a Simple Resource
Yes, I'm referring to a modal. If I include wizard in a form then there are Create and Cancel buttons outside the wizard, which I don't want. I want to show just the wizard with its back, next and create buttons.
4 replies
FFilament
Created by Gandalf on 12/5/2024 in #❓┊help
Disable 'Create' and 'Create & create another' buttons until all required fields are filled
Is there a way to use HasWizard trait with simple resources?
6 replies
FFilament
Created by Gandalf on 12/5/2024 in #❓┊help
Disable 'Create' and 'Create & create another' buttons until all required fields are filled
The reason I'm embedding the wizard inside a form is because I'm using this form elsewhere as well, for example in createOptionForm() method
6 replies
FFilament
Created by Gandalf on 12/5/2024 in #❓┊help
Disable 'Create' and 'Create & create another' buttons until all required fields are filled
Bumping!
6 replies
FFilament
Created by zekerzichtbaar on 1/12/2024 in #❓┊help
White screen when in SPA mode
I do occasionally get that on firefox. I think this happens when you navigate between pages quickly, and livewire starts throttling the requests, as previous requests have not been fulfilled yet.
3 replies
FFilament
Created by Gandalf on 9/24/2024 in #❓┊help
Rich editor alignment formatting?
I've used TinyEditor. Thanks!
6 replies
FFilament
Created by Gandalf on 9/24/2024 in #❓┊help
Rich editor alignment formatting?
TipTap editor requires custom theme. I would like to avoid such setup.
6 replies
FFilament
Created by Gandalf on 9/21/2024 in #❓┊help
Using filters in a custom page
Figured it out. Had to override getViewData()
4 replies
FFilament
Created by Gandalf on 9/13/2024 in #❓┊help
Using shadcn/ui for interface
OK, Thanks!
9 replies
FFilament
Created by Gandalf on 9/13/2024 in #❓┊help
Using shadcn/ui for interface
Could you please guide me to where I should start looking at for swapping out individual components?
9 replies
FFilament
Created by Gandalf on 9/13/2024 in #❓┊help
Using shadcn/ui for interface
OK
9 replies
FFilament
Created by Gandalf on 9/13/2024 in #❓┊help
Using shadcn/ui for interface
Got it, and that's why suggesting the alternative Pines UI which is based on alpine and tailwind
9 replies
FFilament
Created by Gandalf on 9/13/2024 in #❓┊help
Using shadcn/ui for interface
Alternatively, Pines UI which is based on shadcn/ui and hence is very similar to it.
9 replies
FFilament
Created by IndomieRendang on 3/30/2023 in #❓┊help
How to get the select option label using $get?
Does the way remain the save in Filament 3.x?
4 replies
FFilament
Created by developer on 6/5/2024 in #❓┊help
same model policy: multiple resources
I think this question was for me. Here is a sample:
abstract class ModelPolicy
{
public static ?string $slug = 'models';

/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->hasPermission(static::$slug . '.index');
}

/**
* Determine whether the user can view the model.
*/
public function view(User $user, Model $model): bool
{
return $user->hasPermission(static::$slug . '.show');
}
abstract class ModelPolicy
{
public static ?string $slug = 'models';

/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->hasPermission(static::$slug . '.index');
}

/**
* Determine whether the user can view the model.
*/
public function view(User $user, Model $model): bool
{
return $user->hasPermission(static::$slug . '.show');
}
and then,
class AccountPolicy extends ModelPolicy
{
public static ?string $slug = 'accounts';

public function setOpeningBalance(User $user): bool
{
return $user->hasPermission('accounts.set-opening-balance');
}
}
class AccountPolicy extends ModelPolicy
{
public static ?string $slug = 'accounts';

public function setOpeningBalance(User $user): bool
{
return $user->hasPermission('accounts.set-opening-balance');
}
}
Here AccountPolicy has inherited all the methods from ModelPolicy with appropriate customizations through static variables. And custom policy method or overrides are specified in the derived policy, such as setOpeningBalance in this case.
13 replies
FFilament
Created by Gandalf on 5/30/2024 in #❓┊help
filament.exports.download giving 404 in multi-database multi-tenancy setup
Finally managed to solve this by copying the following lines in my routes/tenant.php:
Route::get('/filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('filament.actions');
Route::get('/filament/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class)
->name('filament.imports.failed-rows.download')
->middleware('filament.actions');
Route::get('/filament/exports/{export}/download', DownloadExport::class)
->name('filament.exports.download')
->middleware('filament.actions');
Route::get('/filament/imports/{import}/failed-rows/download', DownloadImportFailureCsv::class)
->name('filament.imports.failed-rows.download')
->middleware('filament.actions');
3 replies
FFilament
Created by Gandalf on 6/6/2024 in #❓┊help
Transform record before import to database
Managed to solve it by appending the following code at the end of beforeFill:
if ($this->record) {
$this->record->data = $this->data['data'];
}
if ($this->record) {
$this->record->data = $this->data['data'];
}
3 replies
FFilament
Created by developer on 6/5/2024 in #❓┊help
same model policy: multiple resources
You can extend the policy to create new policies. That's what I do when I've to use polymorphism. Allows me to customize the policy for specific cases.
13 replies
FFilament
Created by Gandalf on 6/3/2024 in #❓┊help
fillForm on Create Page?
I am not explicitly calling save as that shall be done by the action itself
30 replies
FFilament
Created by Gandalf on 6/3/2024 in #❓┊help
fillForm on Create Page?
This works, just made a little change to the beforeReplicaSaved closure as:
->beforeReplicaSaved(function (Model $replica, array $data): void {
$replica->setRawAttributes($data);
}
->beforeReplicaSaved(function (Model $replica, array $data): void {
$replica->setRawAttributes($data);
}
30 replies