pepperoni dogfart
pepperoni dogfart
FFilament
Created by pepperoni dogfart on 7/10/2024 in #❓┊help
Registration - Password Requirement
Durign a new user signup, is there a place to modify the requirements for the password field? I'm using the Breezy plugin which allows setting such things on the profile update once logged in, but not for the initial signup.
13 replies
FFilament
Created by pepperoni dogfart on 6/20/2024 in #❓┊help
Defer loading on a widget
Following livewire's docs I don't seem to be able to get this working, has anyone had success deferring loading on a widget?
class MyWidget extends BaseWidget
{
public bool $readyToLoad = false;

public function loadData()
{
$this->readyToLoad = true;
}

protected function getStats(): array
{
if (! $this->readyToLoad) {
return [
Stat::make('Loading', 'Loading...')
];
}

sleep (5);

return [
Stat::make('Loaded Widget', 'Done!'),
];
}
}
class MyWidget extends BaseWidget
{
public bool $readyToLoad = false;

public function loadData()
{
$this->readyToLoad = true;
}

protected function getStats(): array
{
if (! $this->readyToLoad) {
return [
Stat::make('Loading', 'Loading...')
];
}

sleep (5);

return [
Stat::make('Loaded Widget', 'Done!'),
];
}
}
10 replies
FFilament
Created by pepperoni dogfart on 6/16/2024 in #❓┊help
Repeat table column
I have a hasMany relationship that I'd like to dynamically add to a filament table based on each relationship found, is this possible? For example in my model, I have
return $this->hasMany(Paid::class)->where('paid');
return $this->hasMany(Paid::class)->where('paid');
I basically want to do a foreach in the filament table, somehow, to make a TextColumn on each one.
3 replies
FFilament
Created by pepperoni dogfart on 5/29/2024 in #❓┊help
Select field using search populate another field.
I have a select field that populates the options via an external API request:
Forms\Components\Select::make('ticket_number')
->searchable()
->getSearchResultsUsing(fn (string $search): array => \App\Models\Ticket::apiTickets($search))
->selectablePlaceholder(false)
->searchingMessage('Searching Tickets...')
->native(false)
->live(),

Forms\Components\TextInput::make('ticket_title')->readOnly(),
Forms\Components\Select::make('ticket_number')
->searchable()
->getSearchResultsUsing(fn (string $search): array => \App\Models\Ticket::apiTickets($search))
->selectablePlaceholder(false)
->searchingMessage('Searching Tickets...')
->native(false)
->live(),

Forms\Components\TextInput::make('ticket_title')->readOnly(),
How can I pass the selected result over to the TextInput field? I couldn't figure this out using afterStateUpdated with the getSearchResultsUsing method on the original field.
4 replies
FFilament
Created by pepperoni dogfart on 5/17/2024 in #❓┊help
Filters - setting opposite when unchecked
Hello, I have a column in the database for "complete" in a basic task list. By default when I view the table, I'd like it to display by default all tasks where complete = false. I was able to add a filter toggle in to show completed tasks, but having an issue figuring out when it's not toggled, those records would be hidden.
2 replies
FFilament
Created by pepperoni dogfart on 12/6/2023 in #❓┊help
Access model data on delete action
I have an odd use case where my model is a remote API resource via calebporzio/sushi. Everything is working great from editing, creating, viewing -- but not deleting. For editing I'm utilizing EditAction::make()->using which references a method on my model that performs the update via API. For delete however, I can't find a way to pass any data of the actual model being deleted so that I can facilitate this on my own on the backend. DeleteAction::make()->after() does not appear to be passed the same $data array as the EditAction. Can anyone think of a different way to go about accomplishing this? Working:
Tables\Actions\EditAction::make()->using(function (Model $record, array $data): Model {
\App\Models\Rule::updateRecordAPI($data);
return $record;
}),
Tables\Actions\EditAction::make()->using(function (Model $record, array $data): Model {
\App\Models\Rule::updateRecordAPI($data);
return $record;
}),
Nothing passed:
Tables\Actions\DeleteAction::make()->after(function (array $data){
dd($data);
})
Tables\Actions\DeleteAction::make()->after(function (array $data){
dd($data);
})
22 replies
FFilament
Created by pepperoni dogfart on 11/30/2023 in #❓┊help
Allow resource label to have other capital letters
No description
3 replies
FFilament
Created by pepperoni dogfart on 5/19/2023 in #❓┊help
Switching from Nova to FIlament, questions on relation manager
When using relation manager, it looks like you have to re-create new/edit forms that may already be present on the relationship resource itself? Is there anyway when you click on a BelongsTo in the related table to simply use the form already created for that original resource instead of having to keep two separate copies of it? Or better yet, the edit button will bring up the original edit page for that resource (same with new)? This is how it works on Nova anyway, just trying to wrap my head around it here.
16 replies