Initial commit for combined ProjectKP
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\View;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
View::composer('layouts.navbar', function ($view) {
|
||||
if (session()->has('api_token')) {
|
||||
$notifications = [
|
||||
['text' => 'Kegiatan sudah ditinjau super admin', 'is_read' => false],
|
||||
['text' => 'Aktivitas berhasil disimpan', 'is_read' => true],
|
||||
['text' => 'Perubahan data tersimpan', 'is_read' => true],
|
||||
];
|
||||
$unreadCount = collect($notifications)->where('is_read', false)->count();
|
||||
$view->with(compact('notifications', 'unreadCount'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user