fix: allow owner role to access all admin api endpoints and see stats

This commit is contained in:
dyzulk
2025-12-30 20:29:35 +07:00
parent a14d788400
commit 1eabedcb5b
6 changed files with 34 additions and 30 deletions

View File

@@ -34,8 +34,8 @@ class InquiryController extends Controller
$inquiry = Inquiry::create($request->all());
try {
// Notify all admins
$admins = User::where('role', 'admin')->get();
// Notify all admins and owners
$admins = User::whereIn('role', [User::ROLE_ADMIN, User::ROLE_OWNER])->get();
Notification::send($admins, new NewInquiryNotification($inquiry));
} catch (\Exception $e) {
// Log the error but fail silently to the user, as the inquiry was saved.