Fix Laravel Pint formatting
This commit is contained in:
@@ -9,8 +9,7 @@ class AdminNotificationSubjectService
|
||||
{
|
||||
public function __construct(
|
||||
protected AdminNotificationUserService $userService
|
||||
) {
|
||||
}
|
||||
) {}
|
||||
|
||||
public function subjectOptions(): array
|
||||
{
|
||||
@@ -31,7 +30,7 @@ class AdminNotificationSubjectService
|
||||
$assignedSubjects = [];
|
||||
$tableReady = DB::getSchemaBuilder()->hasTable('admin_notification_subjects');
|
||||
|
||||
if ($tableReady && !empty($admins)) {
|
||||
if ($tableReady && ! empty($admins)) {
|
||||
$adminIds = array_map('intval', array_column($admins, 'id'));
|
||||
|
||||
$rows = AdminNotificationSubject::query()
|
||||
@@ -59,7 +58,7 @@ class AdminNotificationSubjectService
|
||||
|
||||
public function save(array $posted): array
|
||||
{
|
||||
if (!DB::getSchemaBuilder()->hasTable('admin_notification_subjects')) {
|
||||
if (! DB::getSchemaBuilder()->hasTable('admin_notification_subjects')) {
|
||||
return [
|
||||
'success' => false,
|
||||
'message' => 'Notification subject storage is missing. Run migrations first.',
|
||||
@@ -102,7 +101,7 @@ class AdminNotificationSubjectService
|
||||
if (is_array($subjectRaw)) {
|
||||
foreach ($subjectRaw as $key => $value) {
|
||||
$candidate = is_string($key) ? $key : $value;
|
||||
if (!is_string($candidate)) {
|
||||
if (! is_string($candidate)) {
|
||||
continue;
|
||||
}
|
||||
$candidate = trim($candidate);
|
||||
@@ -118,7 +117,7 @@ class AdminNotificationSubjectService
|
||||
$toDelete = array_values(array_diff($current, $selected));
|
||||
$toInsert = array_values(array_diff($selected, $current));
|
||||
|
||||
if (!empty($toDelete)) {
|
||||
if (! empty($toDelete)) {
|
||||
AdminNotificationSubject::query()
|
||||
->where('admin_id', $adminId)
|
||||
->whereIn('subject', $toDelete)
|
||||
@@ -126,7 +125,7 @@ class AdminNotificationSubjectService
|
||||
$updates += count($toDelete);
|
||||
}
|
||||
|
||||
if (!empty($toInsert)) {
|
||||
if (! empty($toInsert)) {
|
||||
$batch = [];
|
||||
foreach ($toInsert as $subject) {
|
||||
$batch[] = [
|
||||
@@ -147,4 +146,4 @@ class AdminNotificationSubjectService
|
||||
'status' => 200,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user