Mikazor
Mikazor
FFilament
Created by Andrew Wallo on 9/9/2023 in #❓┊help
How do I disable the Auto-saving of Form field relationships?
@Andrew Wallo do you solve it?
4 replies
FFilament
Created by Augus on 9/25/2023 in #❓┊help
Select field issues with combination of Live + Disabled.
Someone figured it out?
10 replies
FFilament
Created by Mikazor on 9/27/2023 in #❓┊help
How to `->getOriginal()` from Model in `afterSave()` hook?
Yes. Observers do not work with mass updates. I need to create an event and a listener to handle mass updates, so my logging logic must be in different places. It's not convenient that's why I want to control my logging action from "controllers". Also, it's useful with filament actions that not change model
8 replies
FFilament
Created by Mikazor on 9/27/2023 in #❓┊help
How to `->getOriginal()` from Model in `afterSave()` hook?
Yes, it's work in beforeSave
protected function beforeSave(): void
{
$this->originalRecord = clone $this->getRecord();
}
protected function beforeSave(): void
{
$this->originalRecord = clone $this->getRecord();
}
I need to create an action log and as I said, I don't want to use observers
8 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
I reproduced the bug. https://github.com/filamentphp/filament/issues/8296 This happens because ->sidebarCollapsibleOnDesktop() in AdminPanelProvider
25 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
It works in a fresh repository. So there is a problem in our code
25 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
Ok. I'll try to recreate it in a clean project and report the bug
25 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
This is a request for a global search. If I deactivate it, there are no requests
25 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
Only 1 http://localhost/livewire/update
25 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
I have a pretty simple form:
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->required()
->autofocus()
->maxLength(255)
->columnSpanFull()
]);
}
public static function form(Form $form): Form
{
return $form
->schema([
Forms\Components\TextInput::make('name')
->required()
->autofocus()
->maxLength(255)
->columnSpanFull()
]);
}
25 replies
FFilament
Created by Albert Lens on 8/18/2023 in #❓┊help
Autofocus not working
@albertlens did you find a solution? I Have the same problem
25 replies
FFilament
Created by Mikazor on 8/31/2023 in #❓┊help
How to test that field hidden in infolist?
hidden() has a conditional logic, I simplify an example
13 replies
FFilament
Created by Mikazor on 8/31/2023 in #❓┊help
How to test that field hidden in infolist?
But the value is null. That's the point
13 replies
FFilament
Created by Mikazor on 8/31/2023 in #❓┊help
How to test that field hidden in infolist?
But what HTML do I need to don't see?
13 replies
FFilament
Created by Mikazor on 8/31/2023 in #❓┊help
How to test that field hidden in infolist?
As far as I know, assertSee is looking for text in HTML. My field is hidden and doesn't have a label so what do I need to assertSee or assertDontSee?
13 replies
FFilament
Created by Mikazor on 8/21/2023 in #❓┊help
Add custom query to a filter
Yes, it works. But I'm not sure for what purpose ->query() exists. Am I not using it right?
8 replies
FFilament
Created by Mikazor on 8/21/2023 in #❓┊help
Add custom query to a filter
This is just a simple example. I have a more complex logic but I want to show that $query->where('causer_id', 1) always applies to a whole table
8 replies
FFilament
Created by Mikazor on 8/17/2023 in #❓┊help
Customizing the creation process of relationship
Yeah, that works. Maybe you know how to customize the delete process?
8 replies
FFilament
Created by Mikazor on 8/17/2023 in #❓┊help
Customizing the creation process of relationship
This is a standard User Model with Role Relation from Spatie Permissions.
// User Resource
public static function form(Form $form): Form
{
return $form->schema([
\Filament\Forms\Components\Section::make()->schema([
\Filament\Forms\Components\TextInput::make('username')
->required(),
\Filament\Forms\Components\TextInput::make('name')
->required(),
\Filament\Forms\Components\TextInput::make('email')
->email(),
\Filament\Forms\Components\TextInput::make('password')
->password()
->dehydrateStateUsing(fn(string $state): string => Hash::make($state))
->dehydrated(fn(?string $state): bool => filled($state))
->required(fn(string $operation): bool => $operation === 'create')
->columnSpan(3),
])->columns(3),

\Filament\Forms\Components\Section::make()->schema([
\Filament\Forms\Components\Select::make('roles')
->multiple()
->relationship('roles', 'name')
->searchable()
->options(Role::all()->pluck('name', 'id'))
])
]);
}
// User Resource
public static function form(Form $form): Form
{
return $form->schema([
\Filament\Forms\Components\Section::make()->schema([
\Filament\Forms\Components\TextInput::make('username')
->required(),
\Filament\Forms\Components\TextInput::make('name')
->required(),
\Filament\Forms\Components\TextInput::make('email')
->email(),
\Filament\Forms\Components\TextInput::make('password')
->password()
->dehydrateStateUsing(fn(string $state): string => Hash::make($state))
->dehydrated(fn(?string $state): bool => filled($state))
->required(fn(string $operation): bool => $operation === 'create')
->columnSpan(3),
])->columns(3),

\Filament\Forms\Components\Section::make()->schema([
\Filament\Forms\Components\Select::make('roles')
->multiple()
->relationship('roles', 'name')
->searchable()
->options(Role::all()->pluck('name', 'id'))
])
]);
}
// Edit User
protected function handleRecordUpdate(Model $record, array $data): Model
{
dd($data); // How to get updated (result of Select::make) relation here?
}
// Edit User
protected function handleRecordUpdate(Model $record, array $data): Model
{
dd($data); // How to get updated (result of Select::make) relation here?
}
array:3 [// app/Filament/Resources/UserResource/Pages/EditUser.php:29
"username" => "123"
"name" => "2345423"
"email" => null
]
array:3 [// app/Filament/Resources/UserResource/Pages/EditUser.php:29
"username" => "123"
"name" => "2345423"
"email" => null
]
8 replies
FFilament
Created by bwurtz999 on 8/14/2023 in #❓┊help
Model History Tracking
This is a good package but it works only with models. If you need to log custom actions it's not enough
14 replies