32 lines
872 B
PHP
32 lines
872 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Club;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Support\Facades\View as FacadesView;
|
|
|
|
class NotificationController extends Controller
|
|
{
|
|
/**
|
|
* Show index page
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function index(): \Illuminate\Contracts\View\View
|
|
{
|
|
/** @var \App\Models\Customer $customerModel */
|
|
$customerModel = auth('club')->user();
|
|
$notificationModels = $customerModel->notifications;
|
|
return view('club.pages.notifications.index', compact('notificationModels'));
|
|
}
|
|
|
|
/**
|
|
* Get notifications count
|
|
*
|
|
* @return \Illuminate\Http\JsonResponse
|
|
*/
|
|
public function notificationsCount(): \Illuminate\Http\JsonResponse
|
|
{
|
|
return response()->json(FacadesView::shared('notifications_count', 0));
|
|
}
|
|
}
|