What's Changed
Added
- Read
CREATE TABLEstatements passed as string literals toDB::statement()andDB::unprepared()in migrations, using the same SQL parsers as schema dumps, by @tiagoabsantos in #2564. Read more about it here. - Infer
Arr::map()callback parameter types and the mapped array type by @Gabrieljr42 in #2587.
Fixed
- Check model properties in
fill()andforceFill()by @uchimaki-vensley in #2618. - Check model properties in
withAttributes()by @uchimaki-vensley in #2599. - Check model properties in
forceCreateMany()andforceCreateManyQuietly()by @uchimaki-vensley in #2600. - Apply model casts to date columns such as
created_atinstead of always reading them as dates by @canvural in 453bff0. - Resolve the enum type of
AsEnumCollectionandAsEnumArrayObjectcasts by @lazerg in #2590. - Return
int|falsefrom modelincrement()anddecrement(), since anupdatinglistener can cancel the update, by @canvural in 0293dbc. - Resolve
factory()from theHasFactorygeneric, including models that set their factory with the$factoryproperty or#[UseFactory], by @mkantautas in #2615 and @canvural in 6dfe581. - Keep the model template type in forwarded static calls on a
class-string<T>, such as$class::findOrFail($id), by @mkantautas in #2616. - Read
#[CollectedBy]from parent models on Laravel 13.4 and newer by @APX403 in #2586. Read more about it here. - Keep the relation type after calling
when()andunless()on a relation by @APX403 in #2603. - Accept deeper nesting and closures in nested eager-load arrays passed to
with(),withOnly(),load(), andloadMissing()by @lazerg in #2583. - Read columns from
ulidMorphs(),numericMorphs(), and their nullable variants in migrations by @mkantautas in #2614. - Treat
rememberToken()columns as nullable by @lazerg in #2611. - Fall back to the bundled SQL parser when phpmyadmin/sql-parser can't parse a schema dump, instead of losing every table in it, by @Cayan in #2588.
- Resolve
EventFakemethods such asdispatched()andhasDispatched()on theEventfacade by @lazerg in #2574. - Resolve
QueueFakemethods such aspushed()andhasPushed()on theQueuefacade by @canvural in 9c1d4f4. - Detect container,
request, andconfiginjection inOctaneCompatibilityRulethrough any constructor argument,make(),get(), andmakeWith()calls, and class-string references by @Gabrieljr42 in #2609. - Avoid
NoEnvCallsOutsideOfConfigRulefalse positives when a config file is analysed in editor mode by @billypoke in #2482. - Only count Laravel's
view()helper when detecting unused views, and reportstatic::make(),self::make(), andparent::make()inNoModelMakeRule, by @GTS-MEGHNI in #2598.
New Contributors
- @billypoke made their first contribution in #2482.
- @tiagoabsantos made their first contribution in #2564.
- @APX403 made their first contribution in #2586.
- @Gabrieljr42 made their first contribution in #2587.
- @GTS-MEGHNI made their first contribution in #2598.
- @mkantautas made their first contribution in #2614.
Full Changelog: v3.13.1...v3.13.2