Add per-app notifications and enforce hosting brand assets.
Deploy Ladill Hosting / deploy (push) Successful in 24s

Wire local notification inbox in the topbar, sync ladillhosting logo and hosting launcher icon, and fix signed-out page branding.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-06 18:27:39 +00:00
co-authored by Cursor
parent a0bcf93e53
commit 7fca4a351a
14 changed files with 437 additions and 46 deletions
@@ -0,0 +1,64 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
class NotificationController extends Controller
{
public function index(Request $request): View
{
$notifications = $request->user()
->notifications()
->latest()
->paginate(20);
return view('notifications.index', compact('notifications'));
}
public function unread(Request $request): JsonResponse
{
$notifications = $request->user()
->unreadNotifications()
->latest()
->take(10)
->get()
->map(fn ($n) => [
'id' => $n->id,
'type' => class_basename($n->type),
'title' => $n->data['title'] ?? 'Notification',
'message' => $n->data['message'] ?? '',
'icon' => $n->data['icon'] ?? 'bell',
'url' => $n->data['url'] ?? null,
'created_at' => $n->created_at->diffForHumans(),
]);
return response()->json([
'notifications' => $notifications,
'unread_count' => $request->user()->unreadNotifications()->count(),
]);
}
public function markAsRead(Request $request, string $id): JsonResponse
{
$notification = $request->user()
->notifications()
->where('id', $id)
->first();
if ($notification) {
$notification->markAsRead();
}
return response()->json(['success' => true]);
}
public function markAllAsRead(Request $request): JsonResponse
{
$request->user()->unreadNotifications->markAsRead();
return response()->json(['success' => true]);
}
}
@@ -0,0 +1,25 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('notifications');
}
};
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

+13 -13
View File
@@ -11,30 +11,30 @@
}
.cls-2 {
fill: #5b95cb;
fill: #30b37c;
}
.cls-3 {
fill: #b573e3;
}
.cls-4 {
fill: #5c9d9e;
}
.cls-4 {
fill: #b573e3;
}
.cls-5 {
fill: #00b6b2;
fill: #5b95cb;
}
.cls-6 {
fill: #30b37c;
fill: #00b6b2;
}
</style>
</defs>
<rect class="cls-3" x="30.6" width="87.7" height="358.1" rx="43.9" ry="43.9"/>
<path class="cls-5" d="M286,96.2H74c-24.2,0-43.9,19.6-43.9,43.9s19.6,43.9,43.9,43.9h211.9c24.2,0,43.9-19.6,43.9-43.9s-19.6-43.9-43.9-43.9Z"/>
<circle class="cls-4" cx="285.5" cy="43.9" r="43.9"/>
<path class="cls-1" d="M285.5,96.2c-24.2,0-43.9,19.6-43.9,43.9v176.1c0,24.2,19.6,43.9,43.9,43.9s43.9-19.6,43.9-43.9v-176.1c0-24.2-19.6-43.9-43.9-43.9Z"/>
<path class="cls-6" d="M241.7,140.1v43.9h44.3c22.2,0,40.6-16.6,43.4-38v-5.8c0-24.2-19.6-43.9-43.9-43.9s-43.9,19.6-43.9,43.9Z"/>
<path class="cls-2" d="M30.6,134.2v11.6c2.9,21.5,21.2,38,43.4,38h44.3v-87.7h-44.3c-22.2,0-40.6,16.6-43.4,38Z"/>
<rect class="cls-4" x="0" y="11.7" width="104.6" height="334.3" rx="52.3" ry="52.3"/>
<rect class="cls-1" x="251.7" y="126.2" width="105.8" height="219.8" rx="52.9" ry="52.9"/>
<path class="cls-6" d="M304.6,126.2H51.7C22.7,126.2,0,150.1,0,178.6s23.3,52.3,52.3,52.3h252.9c29.1,0,52.3-23.3,52.3-52.3s-23.3-52.3-52.3-52.3h-.6Z"/>
<circle class="cls-3" cx="304.1" cy="64" r="52.3"/>
<path class="cls-2" d="M251.7,178.6v52.3h52.9c26.7,0,48.3-19.8,51.7-45.3v-7c0-29.1-23.3-52.3-52.3-52.3s-52.3,23.3-52.3,52.3Z"/>
<path class="cls-5" d="M0,172.2v14c3.5,25.6,25,45.3,51.7,45.3h52.9v-104.6h-52.9C25,126.8,3.5,146.6,0,172.2Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

+25 -25
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 483.6 76.2">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 503.5 76.2">
<defs>
<style>
.cls-1 {
@@ -11,11 +11,11 @@
}
.cls-2 {
fill: #5b95cb;
fill: #30b37c;
}
.cls-3 {
fill: #b573e3;
fill: #5c9d9e;
}
.cls-4 {
@@ -23,39 +23,39 @@
}
.cls-5 {
fill: #5c9d9e;
fill: #b573e3;
}
.cls-6 {
fill: #00b6b2;
fill: #5b95cb;
}
.cls-7 {
fill: #30b37c;
fill: #00b6b2;
}
</style>
</defs>
<rect class="cls-5" x="0" width="23.9" height="76.3" rx="9" ry="9"/>
<rect class="cls-1" x="57.5" y="26.1" width="24.1" height="50.2" rx="9.1" ry="9.1"/>
<g>
<path class="cls-4" d="M116.4,52.4v8.6h-34.8V10.7h8.6v41.8h26.2,0Z"/>
<path class="cls-4" d="M120.1,43c0-2.7.5-5.3,1.5-7.7s2.4-4.4,4.2-6.2c1.8-1.8,3.9-3.1,6.2-4.2,2.4-1,4.9-1.5,7.7-1.5s5.3.5,7.7,1.5,4.4,2.4,6.2,4.2c1.8,1.8,3.1,3.8,4.2,6.2,1,2.4,1.5,4.9,1.5,7.7v18.1h-8.4v-2c-3.3,2.4-7.1,3.5-11.2,3.5s-5.7-.5-8.1-1.5-4.5-2.4-6.2-4.2-3-3.9-4-6.2c-.9-2.4-1.4-4.9-1.4-7.7,0,0,.1,0,.1,0ZM128.5,43c0,1.5.3,3,.9,4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.1,3.2.4c1.1.2,2.1.6,3.1.9,1,.4,1.9.8,2.8,1.3.9.5,1.6,1,2.2,1.6V10.7h8.4v32.3h-.1ZM214.8,43c0-1.5-.3-3-.9-4.4-.6-1.4-1.4-2.6-2.4-3.6s-2.2-1.8-3.6-2.4c-1.4-.6-2.8-.9-4.4-.9s-3,.3-4.4.9c-1.4.6-2.6,1.4-3.6,2.4s-1.8,2.2-2.4,3.6c-.6,1.4-.9,2.8-.9,4.4s.3,3,.9,4.4c.6,1.4,1.4,2.6,2.4,3.6s2.2,1.8,3.6,2.4c1.4.6,2.8.9,4.4.9s3-.3,4.4-.9c1.4-.6,2.6-1.4,3.6-2.4s1.8-2.2,2.4-3.6c.6-1.4.9-2.8.9-4.4Z"/>
<path class="cls-4" d="M227.7,15.9c0-1.5.5-2.8,1.5-3.8s2.2-1.5,3.7-1.5,2.8.5,3.8,1.5,1.5,2.3,1.5,3.8-.5,2.7-1.5,3.7-2.3,1.5-3.8,1.5-2.7-.5-3.7-1.5-1.5-2.2-1.5-3.7ZM228.7,25.1h8.4v36h-8.4V25.1Z"/>
<path class="cls-4" d="M242.8,10.7h8.4v50.4h-8.4V10.7Z"/>
<path class="cls-4" d="M256.9,10.7h8.4v50.4h-8.4V10.7Z"/>
</g>
<rect class="cls-3" x="0" width="18" height="73.5" rx="9" ry="9"/>
<path class="cls-6" d="M52.4,19.7H8.9C3.9,19.7,0,23.8,0,28.7s4,9,9,9h43.5c5,0,9-4,9-9s-4-9-9-9Z"/>
<circle class="cls-5" cx="52.3" cy="9" r="9"/>
<path class="cls-1" d="M52.3,19.7c-5,0-9,4-9,9v36.1c0,5,4,9,9,9s9-4,9-9V28.7c0-5-4-9-9-9Z"/>
<path class="cls-7" d="M43.3,28.7v9h9.1c4.6,0,8.3-3.4,8.9-7.8v-1.2c0-5-4-9-9-9s-9,4-9,9Z"/>
<path class="cls-2" d="M0,27.6v2.4c.6,4.4,4.3,7.8,8.9,7.8h9.1v-18h-9.1c-4.6,0-8.3,3.4-8.9,7.8Z"/>
<path class="cls-7" d="M69.5,26.1H11.8C5.2,26.1,0,31.6,0,38.1s5.3,11.9,11.9,11.9h57.7c6.6,0,11.9-5.3,11.9-11.9s-5.3-11.9-11.9-11.9h-.1Z"/>
<circle class="cls-3" cx="69.4" cy="11.9" r="11.9"/>
<path class="cls-2" d="M57.5,38.1v11.9h12.1c6.1,0,11-4.5,11.8-10.3v-1.6c0-6.6-5.3-11.9-11.9-11.9s-11.9,5.3-11.9,11.9Z"/>
<path class="cls-6" d="M0,36.6v3.2c.8,5.8,5.7,10.3,11.8,10.3h12.1v-23.9h-12.1C5.7,26.3.8,30.8,0,36.6Z"/>
<g>
<path class="cls-4" d="M294,9.5h5v50.4h-5v-19.6h-23.5v19.6h-5V9.5h5v25.8h23.5V9.5Z"/>
<path class="cls-4" d="M301.8,41.9c0-2.7.5-5.3,1.5-7.7,1-2.4,2.4-4.5,4.2-6.3,1.8-1.8,3.9-3.2,6.3-4.2,2.4-1,5-1.5,7.7-1.5s5.3.5,7.7,1.5c2.4,1,4.5,2.4,6.3,4.2,1.8,1.8,3.2,3.9,4.2,6.3,1,2.4,1.5,5,1.5,7.7s-.5,5.3-1.5,7.7c-1,2.4-2.4,4.5-4.2,6.3-1.8,1.8-3.9,3.2-6.3,4.2-2.4,1-5,1.5-7.7,1.5s-5.3-.5-7.7-1.5c-2.4-1-4.5-2.4-6.3-4.2-1.8-1.8-3.2-3.9-4.2-6.3-1-2.4-1.5-5-1.5-7.7ZM306.9,41.9c0,2,.4,3.9,1.2,5.7.8,1.8,1.8,3.4,3.2,4.7,1.3,1.3,2.9,2.4,4.7,3.2,1.8.8,3.7,1.2,5.7,1.2s3.9-.4,5.7-1.2c1.8-.8,3.4-1.8,4.7-3.2,1.3-1.3,2.4-2.9,3.2-4.7.8-1.8,1.2-3.7,1.2-5.7s-.4-3.9-1.2-5.7c-.8-1.8-1.8-3.4-3.2-4.7-1.3-1.3-2.9-2.4-4.7-3.2-1.8-.8-3.7-1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.3,4.3.3.2.6.5.8.8v-4.8h-.1ZM469,41.9c0,2,.4,3.9,1.2,5.7.8,1.8,1.8,3.4,3.2,4.7,1.3,1.3,2.9,2.4,4.7,3.2,1.8.8,3.7,1.2,5.7,1.2s3.9-.4,5.7-1.2c1.8-.8,3.4-1.8,4.7-3.2,1.3-1.3,2.4-2.9,3.2-4.7.8-1.8,1.2-3.9,1.2-6.3s-.3-3.6-1-5.2c-.9-1.8-2-3.3-3.3-4.7-1.3-1.3-2.9-2.4-4.7-3.2-1.8-.8-3.7-1.2-5.7-1.2s-3.9.4-5.7,1.2c-1.8.8-3.4,1.8-4.7,3.2-1.3,1.3-2.4,2.9-3.2,4.7-.8,1.8-1.2,3.7-1.2,5.7h-.1Z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

+85
View File
@@ -5,6 +5,91 @@ import collapse from '@alpinejs/collapse';
Alpine.plugin(collapse);
Alpine.data('notificationDropdown', (config = {}) => ({
open: false,
loading: false,
notifications: [],
unreadCount: 0,
unreadUrl: config.unreadUrl || '/notifications/unread',
markReadUrl: config.markReadUrl || '/notifications/__ID__/read',
markAllReadUrl: config.markAllReadUrl || '/notifications/mark-all-read',
indexUrl: config.indexUrl || '/notifications',
csrfToken: config.csrfToken || document.querySelector('meta[name="csrf-token"]')?.content || '',
init() {
this.fetchUnread();
setInterval(() => this.fetchUnread(), 60000);
},
async fetchUnread() {
try {
const res = await fetch(this.unreadUrl, {
headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' },
});
const data = await res.json();
this.notifications = data.notifications || [];
this.unreadCount = data.unread_count || 0;
} catch (e) {
console.error('Failed to fetch notifications', e);
}
},
toggle() {
this.open = !this.open;
if (this.open) {
this.loading = true;
this.fetchUnread().finally(() => { this.loading = false; });
}
},
async markRead(id) {
const url = this.markReadUrl.replace('__ID__', id);
try {
await fetch(url, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-CSRF-TOKEN': this.csrfToken,
'X-Requested-With': 'XMLHttpRequest',
},
});
this.notifications = this.notifications.filter(n => n.id !== id);
this.unreadCount = Math.max(0, this.unreadCount - 1);
} catch (e) {
console.error('Failed to mark notification as read', e);
}
},
async markAllRead() {
try {
await fetch(this.markAllReadUrl, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'X-CSRF-TOKEN': this.csrfToken,
'X-Requested-With': 'XMLHttpRequest',
},
});
this.notifications = [];
this.unreadCount = 0;
} catch (e) {
console.error('Failed to mark all notifications as read', e);
}
},
getIconBg(icon) {
const map = { domain: 'bg-emerald-50', hosting: 'bg-violet-50', email: 'bg-pink-50', billing: 'bg-amber-50', success: 'bg-green-50' };
return map[icon] || 'bg-slate-100';
},
getIconColor(icon) {
const map = { domain: 'text-emerald-600', hosting: 'text-violet-600', email: 'text-pink-600', billing: 'text-amber-600', success: 'text-green-600' };
return map[icon] || 'text-slate-500';
},
}));
// Afia — Ladill in-app AI assistant (slide-over chat). Opened via the topbar AI button
// which dispatches a window 'afia-open' event. Greeting/suggestions are passed from Blade.
Alpine.data('afia', (config = {}) => ({
+1 -1
View File
@@ -9,7 +9,7 @@
</head>
<body class="flex h-full items-center justify-center bg-slate-100 font-sans">
<div class="text-center">
<img src="{{ asset('images/logo/ladillemail-logo.svg') }}" alt="Ladill Hosting" class="mx-auto h-7 w-auto">
<img src="{{ asset('images/logo/ladillhosting-logo.svg') }}?v={{ @filemtime(public_path('images/logo/ladillhosting-logo.svg')) ?: '1' }}" alt="Ladill Hosting" class="mx-auto h-7 w-auto">
<p class="mt-6 text-sm text-slate-600">Youve been signed out. Redirecting…</p>
<a href="{{ 'https://'.config('app.platform_domain') }}" class="mt-2 inline-block text-sm font-medium text-indigo-600 hover:underline">Go to ladill.com</a>
</div>
+3 -1
View File
@@ -40,7 +40,9 @@
'homeActive' => request()->routeIs('email.dashboard'),
'searchUrl' => route('email.mailboxes.index'),
'searchActive' => request()->routeIs('email.mailboxes.*'),
'notificationsUrl' => $navAcct.'/notifications',
'notificationsUrl' => route('notifications.index'),
'notificationsActive' => request()->routeIs('notifications.*'),
'unreadUrl' => route('notifications.unread'),
'profileActive' => false,
'profileName' => $navUser?->name ?? '',
'profileSubtitle' => $navUser?->email ?? '',
+3 -1
View File
@@ -39,7 +39,9 @@
'homeActive' => request()->routeIs('hosting.dashboard') || request()->routeIs('hosting.index'),
'searchUrl' => route('hosting.dashboard'),
'searchActive' => request()->routeIs('hosting.*'),
'notificationsUrl' => $navAcct.'/notifications',
'notificationsUrl' => route('notifications.index'),
'notificationsActive' => request()->routeIs('notifications.*'),
'unreadUrl' => route('notifications.unread'),
'profileActive' => false,
'profileName' => $navUser?->name ?? '',
'profileSubtitle' => $navUser?->email ?? '',
@@ -0,0 +1,93 @@
<div class="space-y-6">
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div>
<h1 class="text-2xl font-semibold tracking-tight text-gray-900">Notifications</h1>
<p class="mt-1 text-sm text-gray-500">{{ $subtitle ?? 'Stay updated on your account activity.' }}</p>
</div>
@if ($notifications->where('read_at', null)->count() > 0)
<form method="POST" action="{{ route('notifications.mark-all-read') }}">
@csrf
<button type="submit" class="inline-flex items-center gap-1.5 rounded-lg border border-gray-200 bg-white px-3.5 py-2 text-sm font-medium text-gray-700 transition hover:bg-gray-50">
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
Mark all as read
</button>
</form>
@endif
</div>
<div class="rounded-lg border border-gray-200 bg-white">
@forelse ($notifications as $notification)
@php
$data = $notification->data;
$icon = $data['icon'] ?? 'bell';
$iconBg = match ($icon) {
'domain' => 'bg-emerald-50',
'hosting' => 'bg-violet-50',
'email' => 'bg-pink-50',
'billing' => 'bg-amber-50',
'success' => 'bg-green-50',
default => 'bg-slate-100',
};
$iconColor = match ($icon) {
'domain' => 'text-emerald-600',
'hosting' => 'text-violet-600',
'email' => 'text-pink-600',
'billing' => 'text-amber-600',
'success' => 'text-green-600',
default => 'text-slate-500',
};
@endphp
<div class="flex items-start gap-4 border-b border-gray-100 px-5 py-4 last:border-b-0 {{ $notification->read_at ? 'bg-white' : 'bg-indigo-50/30' }}">
<span class="mt-0.5 flex h-10 w-10 shrink-0 items-center justify-center rounded-full {{ $iconBg }}">
@if ($icon === 'domain' && view()->exists('components.icons.domain-globe'))
@include('components.icons.domain-globe', ['class' => 'h-5 w-5 ' . $iconColor])
@elseif ($icon === 'email')
<svg class="h-5 w-5 {{ $iconColor }}" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"/></svg>
@elseif ($icon === 'hosting')
<svg class="h-5 w-5 {{ $iconColor }}" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 14.25h13.5m-13.5 0a3 3 0 0 1-3-3m3 3a3 3 0 1 0 0 6h13.5a3 3 0 1 0 0-6m-16.5-3a3 3 0 0 1 3-3h13.5a3 3 0 0 1 3 3m-19.5 0a4.5 4.5 0 0 1 .9-2.7L5.737 5.1a3.375 3.375 0 0 1 2.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 0 1 .9 2.7m0 0a3 3 0 0 1-3 3m0 3h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Zm-3 6h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Z"/></svg>
@elseif ($icon === 'billing')
<svg class="h-5 w-5 {{ $iconColor }}" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"/></svg>
@elseif ($icon === 'success')
<svg class="h-5 w-5 {{ $iconColor }}" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
@else
<svg class="h-5 w-5 {{ $iconColor }}" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9a6 6 0 1 0-12 0v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.08 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/></svg>
@endif
</span>
<div class="min-w-0 flex-1">
<div class="flex items-start justify-between gap-4">
<div>
<p class="text-sm font-medium text-gray-900">{{ $data['title'] ?? 'Notification' }}</p>
<p class="mt-0.5 text-sm text-gray-600">{{ $data['message'] ?? '' }}</p>
</div>
<span class="shrink-0 text-xs text-gray-400">{{ $notification->created_at->diffForHumans() }}</span>
</div>
@if (! empty($data['url']))
<a href="{{ $data['url'] }}" class="mt-2 inline-flex text-sm font-medium text-indigo-600 hover:text-indigo-700">
View details &rarr;
</a>
@endif
</div>
@if (! $notification->read_at)
<form method="POST" action="{{ route('notifications.mark-read', $notification->id) }}" class="shrink-0">
@csrf
<button type="submit" class="rounded-lg p-1.5 text-gray-400 transition hover:bg-gray-100 hover:text-gray-600" title="Mark as read">
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5"/></svg>
</button>
</form>
@endif
</div>
@empty
<div class="px-5 py-16 text-center">
<svg class="mx-auto h-12 w-12 text-gray-300" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9a6 6 0 1 0-12 0v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.08 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0" />
</svg>
<h3 class="mt-4 text-sm font-medium text-gray-900">No notifications</h3>
<p class="mt-1 text-sm text-gray-500">{{ $emptyMessage ?? "You're all caught up." }}</p>
</div>
@endforelse
</div>
@if ($notifications->hasPages())
<div class="mt-4">{{ $notifications->links() }}</div>
@endif
</div>
@@ -0,0 +1,10 @@
@extends('layouts.hosting')
@section('title', 'Notifications')
@section('content')
@include('notifications._list', [
'subtitle' => 'Hosting activity for your account.',
'emptyMessage' => "You're all caught up. We'll notify you when something happens with your hosting.",
])
@endsection
@@ -0,0 +1,108 @@
{{-- In-app notification bell + dropdown (scoped to this app). --}}
<div class="relative hidden lg:block"
x-data="notificationDropdown({
unreadUrl: {{ \Illuminate\Support\Js::from(route('notifications.unread')) }},
markReadUrl: {{ \Illuminate\Support\Js::from(route('notifications.mark-read', ['id' => '__ID__'])) }},
markAllReadUrl: {{ \Illuminate\Support\Js::from(route('notifications.mark-all-read')) }},
indexUrl: {{ \Illuminate\Support\Js::from(route('notifications.index')) }},
csrfToken: {{ \Illuminate\Support\Js::from(csrf_token()) }},
})"
@click.outside="open = false">
<button type="button"
@click="toggle()"
class="relative inline-flex items-center justify-center rounded-full border border-slate-200 p-2.5 text-slate-600 transition hover:bg-slate-50"
aria-label="Notifications">
<svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="1.7" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9a6 6 0 1 0-12 0v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.08 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/>
</svg>
<span x-show="unreadCount > 0"
x-cloak
x-text="unreadCount > 9 ? '9+' : unreadCount"
class="absolute -right-1 -top-1 inline-flex min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 py-0.5 text-[10px] font-semibold text-white"></span>
</button>
<div x-show="open"
x-cloak
x-transition:enter="transition ease-out duration-150"
x-transition:enter-start="opacity-0 scale-95"
x-transition:enter-end="opacity-100 scale-100"
x-transition:leave="transition ease-in duration-100"
x-transition:leave-start="opacity-100 scale-100"
x-transition:leave-end="opacity-0 scale-95"
class="absolute right-0 z-50 mt-2 w-80 origin-top-right rounded-xl border border-slate-200 bg-white shadow-lg">
<div class="flex items-center justify-between border-b border-slate-100 px-4 py-3">
<h3 class="text-sm font-semibold text-slate-900">Notifications</h3>
<button type="button"
x-show="unreadCount > 0"
@click="markAllRead()"
class="text-xs font-medium text-indigo-600 hover:text-indigo-700">
Mark all read
</button>
</div>
<div class="max-h-80 overflow-y-auto">
<template x-if="loading">
<div class="px-4 py-6 text-center">
<svg class="mx-auto h-5 w-5 animate-spin text-slate-400" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
</svg>
</div>
</template>
<template x-if="!loading && notifications.length === 0">
<div class="px-4 py-8 text-center">
<svg class="mx-auto h-10 w-10 text-slate-300" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9a6 6 0 1 0-12 0v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.08 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/>
</svg>
<p class="mt-2 text-sm text-slate-500">No notifications yet</p>
</div>
</template>
<template x-if="!loading && notifications.length > 0">
<div class="divide-y divide-slate-100">
<template x-for="notification in notifications" :key="notification.id">
<a :href="notification.url || '#'"
@click="markRead(notification.id)"
class="flex items-start gap-3 px-4 py-3 transition hover:bg-slate-50">
<span class="mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-full"
:class="getIconBg(notification.icon)">
<template x-if="notification.icon === 'domain'">
<span class="inline-flex" :class="getIconColor(notification.icon)">
{!! \App\Support\DomainGlobeIcon::svg('h-4 w-4') !!}
</span>
</template>
<template x-if="notification.icon === 'hosting'">
<svg class="h-4 w-4" :class="getIconColor(notification.icon)" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 14.25h13.5m-13.5 0a3 3 0 0 1-3-3m3 3a3 3 0 1 0 0 6h13.5a3 3 0 1 0 0-6m-16.5-3a3 3 0 0 1 3-3h13.5a3 3 0 0 1 3 3m-19.5 0a4.5 4.5 0 0 1 .9-2.7L5.737 5.1a3.375 3.375 0 0 1 2.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 0 1 .9 2.7m0 0a3 3 0 0 1-3 3m0 3h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Zm-3 6h.008v.008h-.008v-.008Zm0-6h.008v.008h-.008v-.008Z"/></svg>
</template>
<template x-if="notification.icon === 'email'">
<svg class="h-4 w-4" :class="getIconColor(notification.icon)" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"/></svg>
</template>
<template x-if="notification.icon === 'billing'">
<svg class="h-4 w-4" :class="getIconColor(notification.icon)" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"/></svg>
</template>
<template x-if="notification.icon === 'success'">
<svg class="h-4 w-4" :class="getIconColor(notification.icon)" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/></svg>
</template>
<template x-if="!['domain','hosting','email','billing','success'].includes(notification.icon)">
<svg class="h-4 w-4" :class="getIconColor(notification.icon)" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9a6 6 0 1 0-12 0v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.08 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/></svg>
</template>
</span>
<div class="min-w-0 flex-1">
<p class="text-sm font-medium text-slate-900 truncate" x-text="notification.title"></p>
<p class="text-xs text-slate-500 line-clamp-2" x-text="notification.message"></p>
<p class="mt-1 text-[11px] text-slate-400" x-text="notification.created_at"></p>
</div>
</a>
</template>
</div>
</template>
</div>
<div class="border-t border-slate-100 px-4 py-2.5">
<a :href="indexUrl" class="block text-center text-xs font-medium text-slate-600 hover:text-slate-900">
View all notifications
</a>
</div>
</div>
</div>
+1 -5
View File
@@ -36,11 +36,7 @@
</div>
<div class="flex items-center gap-2.5">
@auth
{{-- Notifications (desktop header) --}}
<a href="{{ $acct }}/notifications" title="Notifications"
class="hidden items-center justify-center rounded-full border border-slate-200 p-2.5 text-slate-600 transition hover:bg-slate-50 lg:inline-flex">
<svg class="h-5 w-5" fill="none" stroke="currentColor" stroke-width="1.7" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9a6 6 0 0 0-12 0v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.08 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/></svg>
</a>
@include('partials.notification-dropdown')
<span class="hidden h-7 w-px bg-slate-200 lg:block"></span>
+6
View File
@@ -11,6 +11,7 @@ use App\Http\Controllers\Hosting\HostingTerminalSessionController;
use App\Http\Controllers\Hosting\OverviewController;
use App\Http\Controllers\Hosting\SearchController;
use App\Http\Controllers\Hosting\TeamController;
use App\Http\Controllers\NotificationController;
use Illuminate\Support\Facades\Route;
$serversApp = fn (string $path = ''): string => 'https://'.config('app.servers_domain').($path !== '' ? '/'.ltrim($path, '/') : '');
@@ -29,6 +30,11 @@ Route::get('/sso/logout-frontchannel', [SsoLoginController::class, 'frontchannel
Route::get('/signed-out', fn () => auth()->check() ? redirect()->route('hosting.dashboard') : view('hosting.signed-out'))->name('hosting.signed-out');
Route::middleware(['auth'])->group(function () use ($serversApp) {
Route::get('/notifications', [NotificationController::class, 'index'])->name('notifications.index');
Route::get('/notifications/unread', [NotificationController::class, 'unread'])->name('notifications.unread');
Route::post('/notifications/{id}/read', [NotificationController::class, 'markAsRead'])->name('notifications.mark-read');
Route::post('/notifications/mark-all-read', [NotificationController::class, 'markAllAsRead'])->name('notifications.mark-all-read');
Route::get('/search', SearchController::class)->name('hosting.search');
Route::get('/dashboard', [OverviewController::class, 'index'])->name('hosting.dashboard');