1 | <?php |
||
2 | |||
3 | use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
||
4 | use Illuminate\Database\Eloquent\Relations\HasMany; |
||
5 | use Illuminate\Database\Eloquent\Relations\HasManyThrough; |
||
6 | use Illuminate\Database\Eloquent\Relations\MorphMany; |
||
7 | use Illuminate\Database\Eloquent\Relations\MorphToMany; |
||
8 | use Illuminate\Database\Eloquent\Relations\Relation; |
||
9 | |||
10 | Relation::macro( |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
11 | 'isToMany', |
||
12 | function (): bool { |
||
13 | return is_a($this, HasMany::class) || is_a($this, BelongsToMany::class) |
||
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
14 | || is_a($this, MorphMany::class) || is_a($this, MorphToMany::class) |
||
15 | || is_a($this, HasManyThrough::class); |
||
16 | } |
||
17 | ); |
||
18 |