Skip to content

Known limitations ​

  • Laravel 12 with MySQL or PostgreSQL: filters and relation or aggregate sorts through a hasOneThrough relation defined with ofMany() fail in Eloquent itself. Laravel 13 fixes it.
  • PostgreSQL and mixed morph ids: PostgreSQL does not compare columns of different types. When a morphTo stores the ids of several types in one string column (uuids and integers), filters and sorts through it cast the id for every type keyed by an integer or a native uuid primary key; for a string key the column type is read from the schema once per table and request. Aggregate includes under such a type (withCount of Eloquent itself) fail.
  • Filters and sorts through a morphTo do not check that every listed type has the column; a missing column is an SQL error. The macros of a constrain() callback on the morphTo are not replayed in them. onlyIncluded() through a morphTo included by a plain string (not Relationship::morphTo()) without a morph map leaves the models the filter does not list as they are, instead of loading none of them.
  • A root table alias: when query() selects from an alias (User::query()->from('users as u')), the constraint of a relation filter or sort is rewritten to the alias as a whole: a join of your own on the root table inside it refers to the alias too. On Laravel 12, filters and sorts through a relation to a model with SoftDeletes fail under such an alias in Eloquent itself.
  • PostgreSQL and string morph ids: a morphMany/morphOne whose id column is a string (it holds uuids and integers) cannot be loaded, filtered or counted from a model with an integer key in Eloquent itself (character varying = integer).