akaunting/app/Http/ViewComposers/ReadOnlyNotification.php
2022-06-01 10:15:55 +03:00

24 lines
434 B
PHP

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