VR
VR
FFilament
Created by VR on 7/8/2024 in #❓┊help
Range slider in V3
I hope also that it will be part of the core. I will then build one from scratch for my needs. I thought that there is one reliable out there. Tks fro the feedback
3 replies
FFilament
Created by VR on 2/3/2024 in #❓┊help
Edit resource not saving with custom livewire table component in tabs
Hi guys, I will post here the answer for the issue in case somebody else have the same issue. Adding lazy load on load it seems that fixes the issue https://livewire.laravel.com/docs/lazy#lazy-loading-outside-of-the-viewport
4 replies
FFilament
Created by VR on 2/3/2024 in #❓┊help
Edit resource not saving with custom livewire table component in tabs
sure thing 🙂 .... hope that will help But here is some basic code :
class EditProduct extends EditRecord
{
public function form(Form $form): Form
{
return $form
->schema([
Tabs::make('Edit product')->tabs([
Tabs\Tab::make('Info')->schema([
Fieldset::make('General info')->schema([
Toggle::make('is_hidden')->inline(),
...
]),
Tabs\Tab::make('Popular')
->schema([
View::make('popular')->view('filament.products.resources.popular', ['record' => $record])
])
])
])
}
class EditProduct extends EditRecord
{
public function form(Form $form): Form
{
return $form
->schema([
Tabs::make('Edit product')->tabs([
Tabs\Tab::make('Info')->schema([
Fieldset::make('General info')->schema([
Toggle::make('is_hidden')->inline(),
...
]),
Tabs\Tab::make('Popular')
->schema([
View::make('popular')->view('filament.products.resources.popular', ['record' => $record])
])
])
])
}
And the Popular livewire component, is just a simple table preview
class Popular extends Component implements HasForms, HasTable
{
use InteractsWithTable, InteractsWithForms;

public function table(Table $table): Table
{
return $table
->query(PopularModel::query()->where('product_id',$this->product->id)->with('product'))
->columns([
....

}
class Popular extends Component implements HasForms, HasTable
{
use InteractsWithTable, InteractsWithForms;

public function table(Table $table): Table
{
return $table
->query(PopularModel::query()->where('product_id',$this->product->id)->with('product'))
->columns([
....

}
4 replies
FFilament
Created by VR on 1/15/2024 in #❓┊help
Grid TW classes not loaded in filament 3 dashboard
using <x-filament::grid></x-filament::grid> is the way to go 🙂
7 replies
FFilament
Created by VR on 1/15/2024 in #❓┊help
Grid TW classes not loaded in filament 3 dashboard
does filament has some specific classes to use grid on a view page?
7 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
will try that also when time will allow it 🙂
15 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
We can not yet... we plan that for next year because we need to upgrade also the livewire version 🙂 Yes, I agree with that, but still something not right. We build a wrapper around the actions, to require the actions on demand and the difference on the same server is large. Like with normal filament action behavior, the loading time is around 8-10 seconds, and with the actions loaded on demand is under 2 sec.
15 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
*-memory
description: System memory
physical id: 0
size: 31GiB
*-cpu
product: Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
vendor: Intel Corp.
physical id: 1
bus info: cpu@0
width: 64 bits
*-memory
description: System memory
physical id: 0
size: 31GiB
*-cpu
product: Intel(R) Xeon(R) Platinum 8175M CPU @ 2.50GHz
vendor: Intel Corp.
physical id: 1
bus info: cpu@0
width: 64 bits
Yeah, we come across this issue and really don't know the case. We may suspect that is a server issue (this is a testing server), but we can not go with we think when deploying it in production...
15 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
even if I add an empty action() that returns only a string, each action() function add some loading time on the server. Tbh on local I don't see the diference. But here is a simple action that I use:
Action::make('comment')
->button()
->form([
TextInput::make('comment')->required()
])
->action(function (Customer $record, array $data): void {
$comment = new Comment();
$comment->user_id = \Auth::user()->id;
$comment->customer_id = $record->id;;
$comment->comment = $data['comment'] ?? null;
$comment->save();
})
->icon('heroicon-s-chat'),
Action::make('comment')
->button()
->form([
TextInput::make('comment')->required()
])
->action(function (Customer $record, array $data): void {
$comment = new Comment();
$comment->user_id = \Auth::user()->id;
$comment->customer_id = $record->id;;
$comment->comment = $data['comment'] ?? null;
$comment->save();
})
->icon('heroicon-s-chat'),
15 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
I discovered that if I remove the ->action() function from the action itself, the actions are rendering fast, so conditions are not a problem. Is that an expected behavior? is there any other official way to call some functions without the ->action() function? Because if I remove the ->action() function then the form builder or requireCOnfirmation does not work at all.
15 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
is not that is making lots of trips to the server.... the main issue for me is that for each record I have 10-15 actions, and each action has at least 1-2 permissions (which are cached) check and also some status check. The client wants to have at least 100 records per page. Doing all that logic on the first iteration adds 30% to the loading time. I was thinking if there was a way to load the actions on demand: Like creating a column named actions with a button in it, and click to render the logic for that record and show the available actions only for that record.
15 replies
FFilament
Created by VR on 12/11/2023 in #❓┊help
Table actions on demand
I'm using direct TableResource protected function getTableQuery(): \Illuminate\Database\Eloquent\Builder { return Model::query(); } protected function getTableActions(): array { return [ Tables\Actions\ActionGroup::make([ Action::make('debug')... ->visible(fn($record): bool => in_array($record->status, [STATUS::STATUS]) && $this->hasPermissionTo(Permissions::PERMISSION)) ]); ]; } The problem is that I have a lot of conditions for showing the action or not, conditions to create url, permissions check, and so on... and that adds loading time when having 500k records.
15 replies