Fix Laravel Pint formatting
This commit is contained in:
@@ -9,7 +9,7 @@ class NotificationManagementService
|
||||
public function update(int $notificationId, array $payload): array
|
||||
{
|
||||
$notification = Notification::query()->find($notificationId);
|
||||
if (!$notification) {
|
||||
if (! $notification) {
|
||||
return ['ok' => false, 'message' => 'Notification not found.'];
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class NotificationManagementService
|
||||
public function delete(int $notificationId): bool
|
||||
{
|
||||
$notification = Notification::query()->find($notificationId);
|
||||
if (!$notification) {
|
||||
if (! $notification) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class NotificationReadService
|
||||
->where('notification_id', $notificationId)
|
||||
->first();
|
||||
|
||||
if (!$row) {
|
||||
if (! $row) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ class NotificationRecipientService
|
||||
public function getRecipients(string $targetGroup): array
|
||||
{
|
||||
$rows = User::getUsersByRole($targetGroup);
|
||||
|
||||
return is_array($rows) ? $rows : [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,7 @@ class NotificationSendService
|
||||
public function __construct(
|
||||
private NotificationRecipientService $recipients,
|
||||
private NotificationDispatchService $dispatcher
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function send(array $payload, int $actorId): array
|
||||
{
|
||||
@@ -57,11 +56,11 @@ class NotificationSendService
|
||||
]);
|
||||
$created++;
|
||||
|
||||
if (in_array('email', $channels, true) && !empty($user['email'])) {
|
||||
if (in_array('email', $channels, true) && ! empty($user['email'])) {
|
||||
$this->dispatcher->sendEmail((string) $user['email'], (string) $payload['title'], (string) $payload['message']);
|
||||
}
|
||||
|
||||
if (in_array('sms', $channels, true) && !empty($user['phone'])) {
|
||||
if (in_array('sms', $channels, true) && ! empty($user['phone'])) {
|
||||
$this->dispatcher->sendSms((string) $user['phone'], (string) $payload['message']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class NotificationUserListService
|
||||
$sortDir = strtolower((string) ($filters['sort_dir'] ?? 'desc')) === 'asc' ? 'asc' : 'desc';
|
||||
|
||||
$allowedSorts = ['created_at', 'scheduled_at', 'priority'];
|
||||
if (!in_array($sortBy, $allowedSorts, true)) {
|
||||
if (! in_array($sortBy, $allowedSorts, true)) {
|
||||
$sortBy = 'created_at';
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class NotificationUserListService
|
||||
}
|
||||
|
||||
$paginator = $query
|
||||
->orderBy('notifications.' . $sortBy, $sortDir)
|
||||
->orderBy('notifications.'.$sortBy, $sortDir)
|
||||
->paginate($perPage, ['*'], 'page', $page);
|
||||
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user