Add HasMany return type to CustomFilter::statuses() for Larastan

Larastan v3.12.0 added the larastan.relationExistence rule, which
detects Eloquent relations by their declared return type. statuses()
defined the hasMany relation but lacked the ': HasMany' return type, so
the rule could not recognize it and flagged $filter->load([...,
'statuses']) in CustomFilterController.php as referencing a missing
relation. Add the return type to match the sibling keywords() method.
Verified with larastan/larastan v3.12.0 (No errors).
pull/7289/head
Your Name 1 week ago
parent 4dcdc05500
commit 11d547415e

@ -72,7 +72,7 @@ class CustomFilter extends Model
return $this->hasMany(CustomFilterKeyword::class);
}
public function statuses()
public function statuses(): HasMany
{
return $this->hasMany(CustomFilterStatus::class);
}

Loading…
Cancel
Save