nicolaibaaring
nicolaibaaring
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