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?