<?php
 namespace App\Policies; use App\Models\Admin; use App\Models\ProductConfigOption; use Illuminate\Auth\Access\HandlesAuthorization; class ProductConfigOptionPolicy { use HandlesAuthorization; public function viewAny(Admin $admin): bool { return $admin->hasPermissionTo('view product config options'); } public function view(Admin $admin, ProductConfigOption $productConfigOption): bool { return $admin->hasPermissionTo('view product config options'); } public function create(Admin $admin): bool { return $admin->hasPermissionTo('create product config options'); } public function update(Admin $admin, ProductConfigOption $productConfigOption): bool { return $admin->hasPermissionTo('update product config options'); } public function updateAny(Admin $admin): bool { return $admin->hasPermissionTo('update product config options'); } public function delete(Admin $admin, ProductConfigOption $productConfigOption): bool { return $admin->hasPermissionTo('delete product config options'); } public function deleteAny(Admin $admin): bool { return $admin->hasPermissionTo('delete product config options'); } public function archive(Admin $admin, ProductConfigOption $option): bool { return $admin->hasPermissionTo('delete product config options') && ! $option->isArchived(); } public function restore(Admin $admin, ProductConfigOption $option): bool { return $admin->hasPermissionTo('restore product config options') && $option->isArchived(); } public function forceDelete(Admin $admin, ProductConfigOption $option): bool { return $admin->hasPermissionTo('force delete product config options') && $option->isArchived() && ! $option->products()->exists() && ! $option->configOptionValues()->exists(); } } 