David | Fortune Validator
David | Fortune Validator
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
thank you
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
sorry to hassle you again but I wanted your advice if I may:
->modalContent(fn (RelationManager $livewire) => new HtmlString(
Blade::render('@livewire("estimates.actions.pdq.import-price", ["estimate" => $estimate])', [
'estimate' => $livewire->getOwnerRecord()
])
))
->modalContent(fn (RelationManager $livewire) => new HtmlString(
Blade::render('@livewire("estimates.actions.pdq.import-price", ["estimate" => $estimate])', [
'estimate' => $livewire->getOwnerRecord()
])
))
I want to pass some data to the mount of the livewire component. would the above be the right way. It does work but again I want to make sure im doing things the right way
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
actually slightly nicer ways seems to have #[Lazy(isolate: true)] on the livewire component itself
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
on a random pointer. I did notice the use of =lazy="on_load" is needed on the component call, otherwise the first click on the modal is ignored for some reason
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
no problem. Much appreciated
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
HtmlString
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
looks like it needed :
->modalContent(fn () => new HtmlString(Blade::render('@livewire("budget.list-post-tax-adjustements")')))
->modalContent(fn () => new HtmlString(Blade::render('@livewire("budget.list-post-tax-adjustements")')))
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
hmm, im getting Filament\Actions\MountableAction::getModalContent(): Return value must be of type Illuminate\Contracts\View\View|Illuminate\Contracts\Support\Htmlable|null, string returned on your Blade version
15 replies
FFilament
Created by David | Fortune Validator on 2/3/2025 in #❓┊help
Skip View Step
Thank you,. I just came across this as well:

->modalContent(fn()=> Livewire::component('budget.net-adjustments'))
or
->modalContent(fn()=> Livewire::mount('budget.net-adjustments'))

->modalContent(fn()=> Livewire::component('budget.net-adjustments'))
or
->modalContent(fn()=> Livewire::mount('budget.net-adjustments'))
Do you think there is a best way of doing this out of the three options?
15 replies
FFilament
Created by Oddman on 1/7/2025 in #❓┊help
Man... Filament is so damn slow :(
Not sure if it will affect things or not but any chrome extensions causing issues ? ( assuming using chrome)
30 replies
FFilament
Created by David | Fortune Validator on 12/11/2024 in #❓┊help
RepeaterEntry Action - How to get item data?
as always found the answer after posting. If anyone else needs it though here is answer:
->action(function($arguments, $component){
if($component->getState()->type == 'folder') {
return DropboxController::downloadFolder($component->getState()->path);
} else {
return DropboxController::downloadFile($component->getState()->path);
}
})
->action(function($arguments, $component){
if($component->getState()->type == 'folder') {
return DropboxController::downloadFolder($component->getState()->path);
} else {
return DropboxController::downloadFile($component->getState()->path);
}
})
4 replies
FFilament
Created by WiseWill on 12/2/2024 in #❓┊help
Order of Clusters in Navigation
Try $sort
6 replies
FFilament
Created by David | Fortune Validator on 11/28/2024 in #❓┊help
Group Table By Year
So I have managed the following with looking through a couple of other help posts. Is there a most Filament way of doing this though:
public function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn($query) =>
$query
->selectRaw('ROW_NUMBER() OVER (ORDER BY DATE_FORMAT(date, "%Y")) AS id')
->selectRaw('YEAR(date) as year,SUM(sub_total) as turnover, SUM(profit) as profit,SUM(baProfit) as benProfit,SUM(budgetProfit) as budgetProfit')
->groupByRaw('YEAR(date)') // Group by year
->orderBy('year', 'desc') // Sort by year
)
->groupsOnly()
->columns([
Tables\Columns\TextColumn::make('year')
->label('Year')
->sortable(),
Tables\Columns\TextColumn::make('turnover')->numeric(0)
->sortable(),
Tables\Columns\TextColumn::make('profit')->numeric(0)
->sortable(),
Tables\Columns\TextColumn::make('benProfit')->numeric(0)
->sortable(),
Tables\Columns\TextColumn::make('budgetProfit')->numeric(0)
->sortable(),
]);
}
public function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn($query) =>
$query
->selectRaw('ROW_NUMBER() OVER (ORDER BY DATE_FORMAT(date, "%Y")) AS id')
->selectRaw('YEAR(date) as year,SUM(sub_total) as turnover, SUM(profit) as profit,SUM(baProfit) as benProfit,SUM(budgetProfit) as budgetProfit')
->groupByRaw('YEAR(date)') // Group by year
->orderBy('year', 'desc') // Sort by year
)
->groupsOnly()
->columns([
Tables\Columns\TextColumn::make('year')
->label('Year')
->sortable(),
Tables\Columns\TextColumn::make('turnover')->numeric(0)
->sortable(),
Tables\Columns\TextColumn::make('profit')->numeric(0)
->sortable(),
Tables\Columns\TextColumn::make('benProfit')->numeric(0)
->sortable(),
Tables\Columns\TextColumn::make('budgetProfit')->numeric(0)
->sortable(),
]);
}
3 replies
FFilament
Created by Arlind Musliu on 1/5/2024 in #❓┊help
Group by date and summarize number of pages
Hi, I hope you dont mind me jumping on this: I wanted to group by Year only.
public function table(Table $table): Table
{
return $table->query(
Invoice::query()
->groupByRaw('DATE_FORMAT(date, "%Y")')
->selectRaw('ROW_NUMBER() OVER (ORDER BY DATE_FORMAT(date, "%Y")) AS id')
->selectRaw('DATE_FORMAT(date, "%Y") as date, SUM(profit) as pages')
->orderBy('date', 'desc')
->where('client_id', $this->getOwnerRecord()->id)
->limit(10)
)
->columns([
Tables\Columns\TextColumn::make('date')
->label('Year')
->date('Y'),
Tables\Columns\TextColumn::make('pages')
->label('Pages Read'),
])
->groupsOnly();


}
public function table(Table $table): Table
{
return $table->query(
Invoice::query()
->groupByRaw('DATE_FORMAT(date, "%Y")')
->selectRaw('ROW_NUMBER() OVER (ORDER BY DATE_FORMAT(date, "%Y")) AS id')
->selectRaw('DATE_FORMAT(date, "%Y") as date, SUM(profit) as pages')
->orderBy('date', 'desc')
->where('client_id', $this->getOwnerRecord()->id)
->limit(10)
)
->columns([
Tables\Columns\TextColumn::make('date')
->label('Year')
->date('Y'),
Tables\Columns\TextColumn::make('pages')
->label('Pages Read'),
])
->groupsOnly();


}
the sum works but the date column shows the same year in each row. any ideas?
3 replies
FFilament
Created by jop00 on 9/20/2023 in #❓┊help
Group table by year
a year late but didnt anyone figure this out?
8 replies
FFilament
Created by David | Fortune Validator on 11/23/2024 in #❓┊help
Infolist data from Form textarea
I’ll give this a whirl, thank you
6 replies
FFilament
Created by David | Fortune Validator on 11/23/2024 in #❓┊help
Infolist data from Form textarea
I did try that but it didn’t give me the line breaks
6 replies
FFilament
Created by thedangler on 11/9/2024 in #❓┊help
Custom Page canAccess runs after mount ?
did you get anywhere with this? Noticing the same. I would also like to access the record within the canAccess but didnt find a way
5 replies
FFilament
Created by morty on 8/16/2024 in #❓┊help
Is there a more succinct way of retrieving a count of a resource inside a `ManageRelatedRecords`?
shame. Try that snippet above. I tried yours but the it was failing when I added a record. Try my code, seems okay for me
9 replies
FFilament
Created by morty on 8/16/2024 in #❓┊help
Is there a more succinct way of retrieving a count of a resource inside a `ManageRelatedRecords`?
I went with this:
public static function getNavigationBadge(): ?string
{
$count = static::getResource()::getModel()::find(request()->route('record'))?->notes->count();
if($count > 0){
return $count;
}
return null;
}
public static function getNavigationBadge(): ?string
{
$count = static::getResource()::getModel()::find(request()->route('record'))?->notes->count();
if($count > 0){
return $count;
}
return null;
}
9 replies