SebboRR
SebboRR
FFilament
Created by SebboRR on 1/14/2025 in #❓┊help
Windows 8.1 - UI only partially loads - ':popover-open' is not a valid selector
Subject: Request to Update Livewire Dependency to v3.5.13 (or later) Hi Team, I hope this message finds you well. I noticed that the current version of filament/support (v3.2.133) requires livewire/livewire (v3.5.12) as a dependency. Unfortunately, there's a known issue in Livewire v3.5.12 that has been resolved in v3.5.13. https://github.com/livewire/livewire/discussions/8941 https://github.com/livewire/livewire/discussions/9002 Would it be possible to update the dependency to allow for Livewire v3.5.13 (or later) in a future release of Filament? This would enable users to benefit from the fixes in the newer Livewire version while maintaining compatibility with Filament. Thank you for all your hard work and for continually improving this amazing package! Best regards,
3 replies
FFilament
Created by SebboRR on 3/17/2024 in #❓┊help
How to GrpupBy and Sum in Widget Table.
Ok, it took me a while to get it to work, but it's working now
class InstrumentsInAccounts extends BaseWidget
{

protected int | string | array $columnSpan = 'full';

protected static ?int $sort = 2;
public int | string $perPage = 20;

public function table(Table $table): Table
{
return $table
->query(
TransactionResource::getEloquentQuery()
->where('number','>',0)
->groupBy('account_id', 'instrument_id')
->select(
'id',
'account_id',
'instrument_id',
'transaction_type',
DB::raw('SUM(number) as number'),
DB::raw('SUM(value) * -1 as value'),
DB::raw('AVG(price) as price')
)
)

->columns([

TextColumn::make('account.name')->sortable(),

TextColumn::make('instrument.name'),
TextColumn::make('instrument.ticker_google_finanse')
->label(__('Ticker')),

TextColumn::make('price')
->label(__('AVG Price'))
->money('PLN', locale: 'pl')
->alignRight(),

TextColumn::make('number')
->label(__('Quantity available'))
->alignRight()
->summarize(Sum::make()),

TextColumn::make('value')
->label(__('Purchase equity'))
->money('PLN', locale: 'pl')
->alignRight()
->summarize(Sum::make()->label('Total value')),
]);
}
}
class InstrumentsInAccounts extends BaseWidget
{

protected int | string | array $columnSpan = 'full';

protected static ?int $sort = 2;
public int | string $perPage = 20;

public function table(Table $table): Table
{
return $table
->query(
TransactionResource::getEloquentQuery()
->where('number','>',0)
->groupBy('account_id', 'instrument_id')
->select(
'id',
'account_id',
'instrument_id',
'transaction_type',
DB::raw('SUM(number) as number'),
DB::raw('SUM(value) * -1 as value'),
DB::raw('AVG(price) as price')
)
)

->columns([

TextColumn::make('account.name')->sortable(),

TextColumn::make('instrument.name'),
TextColumn::make('instrument.ticker_google_finanse')
->label(__('Ticker')),

TextColumn::make('price')
->label(__('AVG Price'))
->money('PLN', locale: 'pl')
->alignRight(),

TextColumn::make('number')
->label(__('Quantity available'))
->alignRight()
->summarize(Sum::make()),

TextColumn::make('value')
->label(__('Purchase equity'))
->money('PLN', locale: 'pl')
->alignRight()
->summarize(Sum::make()->label('Total value')),
]);
}
}
3 replies
FFilament
Created by SebboRR on 2/28/2024 in #❓┊help
How to set custom badge color based on color picker.
Ok i definied colors from tailwind default color palette in boot():
FilamentColor::register([
'gray' => Color::Gray,
'zinc' => Color::Zinc,
'neutral' => Color::Neutral,
'stone' => Color::Stone,
'red' => Color::Red,
'orange' => Color::Orange,
'amber' => Color::Amber,
'yellow' => Color::Yellow,
'lime' => Color::Lime,
'green' => Color::Green,
'emerald' => Color::Emerald,
'teal' => Color::Teal,
'cyan' => Color::Cyan,
'sky' => Color::Sky,
'blue' => Color::Blue,
'indigo' => Color::Indigo,
'violet' => Color::Violet,
'purple' => Color::Purple,
'fuchsia' => Color::Fuchsia,
'pink' => Color::Pink,
'rose' => Color::Rose,
]);
FilamentColor::register([
'gray' => Color::Gray,
'zinc' => Color::Zinc,
'neutral' => Color::Neutral,
'stone' => Color::Stone,
'red' => Color::Red,
'orange' => Color::Orange,
'amber' => Color::Amber,
'yellow' => Color::Yellow,
'lime' => Color::Lime,
'green' => Color::Green,
'emerald' => Color::Emerald,
'teal' => Color::Teal,
'cyan' => Color::Cyan,
'sky' => Color::Sky,
'blue' => Color::Blue,
'indigo' => Color::Indigo,
'violet' => Color::Violet,
'purple' => Color::Purple,
'fuchsia' => Color::Fuchsia,
'pink' => Color::Pink,
'rose' => Color::Rose,
]);
Then i can use it in badge color()
9 replies
FFilament
Created by SebboRR on 2/28/2024 in #❓┊help
How to set custom badge color based on color picker.
Thank you for your answer, but the function ->color() seems to only accept arguments: 'primary', 'success' , etc... . I probably need to write my own template for bage.
9 replies
FFilament
Created by SebboRR on 2/28/2024 in #❓┊help
How to set custom badge color based on color picker.
Color is in crm_level table in color_picker column
9 replies
FFilament
Created by SebboRR on 2/28/2024 in #❓┊help
How to set custom badge color based on color picker.
I want to have custom color based on $record->crm_level->color_picker
9 replies
FFilament
Created by SebboRR on 2/28/2024 in #❓┊help
How to set custom badge color based on color picker.
In table:
Tables\Columns\TextColumn::make('crm_level.name')
->searchable()
->sortable()
->badge()
->color(fn (Company $record): string => match ($record->crm_level->id) {
1 => 'success',
2 => 'warning',
3 => 'gray',
default => 'gray',
})
Tables\Columns\TextColumn::make('crm_level.name')
->searchable()
->sortable()
->badge()
->color(fn (Company $record): string => match ($record->crm_level->id) {
1 => 'success',
2 => 'warning',
3 => 'gray',
default => 'gray',
})
9 replies
FFilament
Created by SebboRR on 2/20/2024 in #❓┊help
Many to Many (Polymorphic) in Table View
Thank you very much, it worked 😉
5 replies