-
resources/views/components/notification.blade.php
Open in GitHub<div class="ms-auto" data-turbolinks-permanent> <a href="{{ route('platform.notifications') }}" class="nav-link p-0 d-flex align-items-center" data-controller="notification" data-notification-count="{{ count($notifications) }}" data-notification-url="{{ route('platform.api.notifications') }}" data-notification-method="post" data-notification-interval="{{ config('platform.notifications.interval') }}" > <x-orchid-icon path="bell"/> <template id="notification-circle"> <x-orchid-icon path="circle" width="0.5em" height="0.5em" /> </template> <span class="badge badge-sm up bg-danger text-white" data-notification-target="badge"></span> </a> </div>
-
resources/views/partials/profile.blade.php
Open in GitHub<div class="d-flex m-0 align-items-center p-3"> // <x-orchid-notification/> </div>
-
src/Platform/Providers/FoundationServiceProvider.php
Open in GitHubuse Illuminate\Support\ServiceProvider; use Orchid\Platform\Components\Notification; class FoundationServiceProvider extends ServiceProvider { public function register(): void { // Blade::component('orchid-notification', Notification::class); } }
-
src/Platform/Components/Notification.php
Open in GitHubuse Illuminate\Contracts\View\View; use Illuminate\Http\Request; use Illuminate\View\Component; use Orchid\Platform\Notifications\DashboardMessage; class Notification extends Component { public $notifications; public function __construct(Request $request) { $this->notifications = $request->user() ->unreadNotifications() ->where('type', DashboardMessage::class) ->limit(15) ->get(); } public function render() { return view('platform::components.notification'); } public function shouldRender() { return config('platform.notifications.enabled', true); } }