CustomerLogPolice.php 518 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Policies;
  3. use App\CustomerLog;
  4. use App\User;
  5. use Illuminate\Auth\Access\HandlesAuthorization;
  6. class CustomerLogPolice
  7. {
  8. use HandlesAuthorization;
  9. protected $cache_key = 'customerLog_update_auth_';
  10. public function update(User $user, CustomerLog $customerLog): bool
  11. {
  12. return (int)$user->id === (int)$customerLog->user_id;
  13. }
  14. public function destroy(User $user, CustomerLog $customerLog)
  15. {
  16. return (int)$user->id === (int)$customerLog->user_id;
  17. }
  18. }