nicolaibaaring
nicolaibaaring
FFilament
Created by nicolaibaaring on 12/11/2024 in #❓┊help
Actions on relation managers load when clicked but never execute the action
The actions that I put on relation managers do not work. They are perfectly set up and visible, but when clicking, they do not execute the actual action callback. The loading spinner loads and the request returns status 200, but nothing happens. I have set up a completely new record with relation manager too and the same happens.
->actions([
Action::make('notAttending')
->label('Mark not attending')
->action(function(Model $record, RelationManager $livewire) {
dd('This is not reached');
}),
])
->actions([
Action::make('notAttending')
->label('Mark not attending')
->action(function(Model $record, RelationManager $livewire) {
dd('This is not reached');
}),
])
The Filament version is 3.2.124 (newest). Some debugging shows:
$this->isLivewireClickHandlerEnabled() // true
$this->getLivewireEventClickHandler() // null
parent::getAlpineClickHandler() // null
$this->canAccessSelectedRecords() // false
$this->generateJavaScriptClickHandler('mountAction') // "mountAction('notAttending', '287888907293561632')"
$this->isLivewireClickHandlerEnabled() // true
$this->getLivewireEventClickHandler() // null
parent::getAlpineClickHandler() // null
$this->canAccessSelectedRecords() // false
$this->generateJavaScriptClickHandler('mountAction') // "mountAction('notAttending', '287888907293561632')"
Any idea what could be causing this?
2 replies
FFilament
Created by nicolaibaaring on 11/18/2024 in #❓┊help
Eloquent query using integers not working in Filament context
When using a custom query builder/scope with a scope like this:
public function inProject(int $projectId): self
{
return $this->where('project_id', $projectId);
}
public function inProject(int $projectId): self
{
return $this->where('project_id', $projectId);
}
and using it in a resource like this:
public static function getEloquentQuery(): Builder
{
$projectId = 1234356789; // This is an snowflake integer id
/** @var ProjectQueryBuilder $query */
$query = parent::getEloquentQuery();

return $query
->inProject($projectId);
}
public static function getEloquentQuery(): Builder
{
$projectId = 1234356789; // This is an snowflake integer id
/** @var ProjectQueryBuilder $query */
$query = parent::getEloquentQuery();

return $query
->inProject($projectId);
}
Filament does not retrieve anything. The project_id is an unsignedBigInteger. When using the same query scope outside of Filament context, the opposite would be true - and the query parameter would have to be cast to integer to retrieve the right data. What in Filament is causing this behavior? Is it intended behavior or a bug? Does anyone have a suggestion for a fix?
4 replies
FFilament
Created by nicolaibaaring on 6/11/2024 in #❓┊help
Query string on simple resource modals
Is there a built-in way to fill the query string when the modal of a simple resource is open, so that it is possible to navigate directly to it as if it was a page?
3 replies