| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Http\Controllers\Controller;
- use App\Models\NotificationDeliveryLog;
- use Illuminate\Http\Request;
- class AdminNotificationLogController extends Controller
- {
- protected array $data = [
- 'active' => 'notification_logs',
- 'title' => 'Журнал уведомлений',
- 'id' => 'notification_logs',
- 'header' => [
- 'created_at' => 'Дата и время',
- 'channel' => 'Канал',
- 'user_id' => 'Пользователь',
- 'status' => 'Статус',
- 'message' => 'Сообщение',
- ],
- 'searchFields' => [
- 'message',
- 'error',
- ],
- ];
- public function index(Request $request)
- {
- session(['gp_notification_logs' => $request->all()]);
- $model = new NotificationDeliveryLog();
- $this->createFilters($model, 'channel', 'status', 'user_id');
- $this->createDateFilters($model, 'created_at');
- $q = NotificationDeliveryLog::query()->with('user');
- $this->acceptFilters($q, $request);
- $this->acceptSearch($q, $request);
- $this->setSortAndOrderBy($model, $request);
- $this->applyStableSorting($q);
- $this->data['logs'] = $q->paginate($this->data['per_page'])->withQueryString();
- return view('admin.notifications.log', $this->data);
- }
- }
|