2024-07-05 10:35:26 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Club;
|
|
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
2024-07-18 12:13:35 +02:00
|
|
|
use Illuminate\Support\Facades\View as FacadesView;
|
2024-07-05 10:35:26 +02:00
|
|
|
|
|
|
|
|
class NotificationController extends Controller
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Show index page
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Contracts\View\View
|
|
|
|
|
*/
|
2024-07-29 11:32:50 +02:00
|
|
|
public function index(): \Illuminate\Contracts\View\View
|
2024-07-05 10:35:26 +02:00
|
|
|
{
|
2024-07-29 11:32:50 +02:00
|
|
|
/** @var \App\Models\Customer $customerModel */
|
|
|
|
|
$customerModel = auth('club')->user();
|
|
|
|
|
$notificationModels = $customerModel->notifications;
|
|
|
|
|
return view('club.pages.notifications.index', compact('notificationModels'));
|
2024-07-05 10:35:26 +02:00
|
|
|
}
|
2024-07-18 12:13:35 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get notifications count
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Http\JsonResponse
|
|
|
|
|
*/
|
2024-07-29 11:32:50 +02:00
|
|
|
public function notificationsCount(): \Illuminate\Http\JsonResponse
|
2024-07-18 12:13:35 +02:00
|
|
|
{
|
|
|
|
|
return response()->json(FacadesView::shared('notifications_count', 0));
|
|
|
|
|
}
|
2024-07-05 10:35:26 +02:00
|
|
|
}
|