Implementa gestão Filament de configurações, serviços, portfólio e depoimentos com policies admin-only, upload validado e seed determinístico. Co-authored-by: Cursor <cursoragent@cursor.com>
47 lines
907 B
PHP
47 lines
907 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Testimonial;
|
|
use App\Models\User;
|
|
|
|
class TestimonialPolicy
|
|
{
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
|
|
public function view(User $user, Testimonial $testimonial): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
|
|
public function update(User $user, Testimonial $testimonial): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
|
|
public function delete(User $user, Testimonial $testimonial): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
|
|
public function restore(User $user, Testimonial $testimonial): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
|
|
public function forceDelete(User $user, Testimonial $testimonial): bool
|
|
{
|
|
return $user->isAdmin();
|
|
}
|
|
}
|