From 05de37a4d7a681d0f255a852fd25660d26a2f24a Mon Sep 17 00:00:00 2001 From: Anatoliy Poloz Date: Wed, 24 Jan 2024 11:32:27 +0300 Subject: [PATCH] ci issues fix --- app/Models/Plan.php | 1 + app/Policies/PlanPolicy.php | 2 +- app/Rules/MinWords.php | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Plan.php b/app/Models/Plan.php index d807a6e..9ca065f 100644 --- a/app/Models/Plan.php +++ b/app/Models/Plan.php @@ -32,6 +32,7 @@ use Spatie\Sluggable\SlugOptions; * @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $updated_at * @property string $slug + * * @property-read \Illuminate\Database\Eloquent\Collection $author * @property-read int|null $author_count * @property-read \Illuminate\Database\Eloquent\Collection $comments diff --git a/app/Policies/PlanPolicy.php b/app/Policies/PlanPolicy.php index 536b452..94dca0a 100755 --- a/app/Policies/PlanPolicy.php +++ b/app/Policies/PlanPolicy.php @@ -14,6 +14,6 @@ class PlanPolicy private function isAuthorPlan(User $user, Plan $plan): bool { - return $user->id === $plan->author()->first()->id; + return $user->id === optional($plan->author()->first())->id; } } diff --git a/app/Rules/MinWords.php b/app/Rules/MinWords.php index 3a08281..cfb1c24 100644 --- a/app/Rules/MinWords.php +++ b/app/Rules/MinWords.php @@ -3,7 +3,6 @@ namespace App\Rules; use Closure; -use Illuminate\Contracts\Validation\Rule; use Illuminate\Contracts\Validation\ValidationRule; class MinWords implements ValidationRule