feat: add private existing business draft foundation

This commit is contained in:
2026-09-28 17:01:10 +02:00
parent 24a0ef1db3
commit 519b256ffd
10 changed files with 398 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
<?php
namespace App\Policies;
use App\Models\ExistingBusiness;
use App\Models\User;
class ExistingBusinessPolicy
{
public function create(User $user): bool
{
return $user->hasVerifiedEmail();
}
public function update(User $user, ExistingBusiness $business): bool
{
return $user->hasVerifiedEmail() && $business->owner_user_id === $user->id && ! $business->trashed();
}
public function view(User $user, ExistingBusiness $business): bool
{
return $this->update($user, $business);
}
public function delete(User $user, ExistingBusiness $business): bool
{
return $this->update($user, $business);
}
}