SUNSHINE
SUNSHINE
FFilament
Created by SUNSHINE on 2/14/2024 in #❓┊help
419 page Expired when sharing sessions across many Laravel projects
No description
32 replies
FFilament
Created by SUNSHINE on 11/9/2023 in #❓┊help
Resource, custom page with widgets, how to sent the $record ?
Hey guys, I've created a custom page on a Resource, but on the widgets I would like to get the record, do you know how to do it ?
class ChartOrganization extends Page
{
protected static string $resource = OrganizationResource::class;

protected static string $view = 'filament.resources.organization-resource.pages.chart-organization';

public ?Organization $record;

protected function getHeaderWidgets(): array
{
return [
OrganizationResource\Widgets\QuotaWidget::class, // $this->record is null inside the widget.
];
}
}
class ChartOrganization extends Page
{
protected static string $resource = OrganizationResource::class;

protected static string $view = 'filament.resources.organization-resource.pages.chart-organization';

public ?Organization $record;

protected function getHeaderWidgets(): array
{
return [
OrganizationResource\Widgets\QuotaWidget::class, // $this->record is null inside the widget.
];
}
}
3 replies
FFilament
Created by SUNSHINE on 11/9/2023 in #❓┊help
Adding tab to View page ?
No description
6 replies
FFilament
Created by SUNSHINE on 11/8/2023 in #❓┊help
Place widgets between view & relations components?
No description
3 replies
FFilament
Created by SUNSHINE on 11/7/2023 in #❓┊help
Adding Chart widget to a view/edit page resource ?
Hey guys, Do you know if it's possible to add a chart/widget such as on the index page but in a view/edit page of a resource? Thankssss
3 replies
FFilament
Created by SUNSHINE on 11/5/2023 in #❓┊help
Compile CSS classes assets ?
Hey guys, I just create a new resources/logo.blade.php asset with some TailwindCSS classes. I've try npm run build, but it doesn't add the classes that I'm using on this file, do you know what's wrong ? I'm using th eclass fill-green-400
16 replies
FFilament
Created by SUNSHINE on 10/25/2023 in #❓┊help
How to load asynchronously a widget ?
Hey guys, I try to add a new widget to my dashboard using the LineChart, but the problem is about the time to perform the request... It take several seconds because we have a database with many millions of records. Do you know if it exist a method to load that async? Thanks
39 replies
FFilament
Created by SUNSHINE on 10/25/2023 in #❓┊help
Custom Column
Hi guys, I would like to create a custom column value, but don't know how ? It's a "complex" query (and I have many like that), but don't know how to inject the code on it.
Tables\Columns\TextColumn::make('feedbacks_count')->formatStateUsing(fn (string $state): string => 'my_custom_query'),
Tables\Columns\TextColumn::make('feedbacks_count')->formatStateUsing(fn (string $state): string => 'my_custom_query'),
56 replies
FFilament
Created by SUNSHINE on 3/21/2023 in #❓┊help
Hide element depending of the value of another element
Hello, do you know how can I hide an element depending of the value of another ?
private const TYPES = [
'text' => 'Texte',
'numeric' => 'Numérique',
'address' => 'Adresse',
'textarea' => 'Textarea',
'checkbox' => 'Checkbox',
'toggle' => 'Toggle',
'select' => 'Liste de sélection',
];


Forms\Components\Select::make('type')->options(self::TYPES)->label('Type du champs')->required(),
Forms\Components\TagsInput::make('options')->separator(',')
->hidden(
fn ($get): bool => $get('type') === 'Liste de sélection'
),
private const TYPES = [
'text' => 'Texte',
'numeric' => 'Numérique',
'address' => 'Adresse',
'textarea' => 'Textarea',
'checkbox' => 'Checkbox',
'toggle' => 'Toggle',
'select' => 'Liste de sélection',
];


Forms\Components\Select::make('type')->options(self::TYPES)->label('Type du champs')->required(),
Forms\Components\TagsInput::make('options')->separator(',')
->hidden(
fn ($get): bool => $get('type') === 'Liste de sélection'
),
4 replies
FFilament
Created by SUNSHINE on 3/20/2023 in #❓┊help
Spatie Media Library - delay submit button to be disabled
Hello, I'm using the spatie-media-library for Filament, and when uploading a file, there is a delay for the button submit to be disabled. Do you know how can I reduce this delay ?
1 replies
FFilament
Created by SUNSHINE on 3/15/2023 in #❓┊help
Create Action on relation manager, how to generate a password ?
Hello, do you know in a relation manager how can I define a password and send a mail after the creation.. ? Since it's a static method and I can't store the password as a property of my object.
Tables\Actions\CreateAction::make()->mutateFormDataUsing(function (array $data) {
$data['type'] = UserTypeEnum::PARTNER;
$data['password'] = ($this->password = Hash::make(Str::random(15))); // don't work on a static method
return $data;
})->after(fn () => Mail::to($this->record)->send(
new UserCredentials($this->record, $this->password)
)),
Tables\Actions\CreateAction::make()->mutateFormDataUsing(function (array $data) {
$data['type'] = UserTypeEnum::PARTNER;
$data['password'] = ($this->password = Hash::make(Str::random(15))); // don't work on a static method
return $data;
})->after(fn () => Mail::to($this->record)->send(
new UserCredentials($this->record, $this->password)
)),
9 replies