akaunting/app/Http/ViewComposers/ReadOnlyNotification.php

24 lines
434 B
PHP
Raw Normal View History

2022-04-25 15:04:04 +03:00
<?php
namespace App\Http\ViewComposers;
use Illuminate\View\View;
class ReadOnlyNotification
{
public function compose(View $view): void
{
if (! config('read-only.enabled')) {
return;
}
2022-06-01 10:15:55 +03:00
$notifications = $view->getData()['notifications'];
$notifications[] = view('components.read-only');
$view->with([
'notifications' => $notifications,
]);
2022-04-25 15:04:04 +03:00
}
}