Skip to content

Commit

Permalink
deleting a nested BelongsTo relation now triggers model events on the…
Browse files Browse the repository at this point in the history
… deleted model
  • Loading branch information
skaesdorf committed Jul 19, 2024
1 parent 8f7d90f commit 1cd1188
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Schema/Directives/DeleteDirective.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function __invoke($model, $idOrIds): void
$relation->getParent()->save();
}

$relation->delete();
$relation->first()->delete();

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.2 with Laravel ^11 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.3 with Laravel ^10 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.3 with Laravel ^11 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.0 with Laravel ^9 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.3 with Laravel ^9 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.3 with Laravel ^11 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.2 with Laravel ^11 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.2 with Laravel ^10 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.2 with Laravel ^9 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.2 with Laravel ^9 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.1 with Laravel ^9 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.3 with Laravel ^9 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.1 with Laravel ^10 and highest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.3 with Laravel ^10 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.1 with Laravel ^10 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.1 with Laravel ^9 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.2 with Laravel ^10 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.

Check failure on line 93 in src/Schema/Directives/DeleteDirective.php

View workflow job for this annotation

GitHub Actions / PHPStan on PHP 8.0 with Laravel ^9 and lowest dependencies

Cannot call method delete() on Illuminate\Database\Eloquent\Model|null.
}
} else {
// @phpstan-ignore-next-line Relation&Builder mixin not recognized
Expand Down

0 comments on commit 1cd1188

Please sign in to comment.