added read-only mode #28nd2px

This commit is contained in:
Denis Duliçi
2022-04-25 15:04:04 +03:00
parent 938d43c58b
commit 685aadd67c
11 changed files with 192 additions and 2 deletions

View File

@ -24,6 +24,10 @@ class Blade extends ServiceProvider
Facade::directive('widget', function ($expression) {
return "<?php echo show_widget($expression); ?>";
});
Facade::if('readonly', function () {
return config('read-only.enabled');
});
}
/**

View File

@ -48,6 +48,10 @@ class Event extends Provider
'Illuminate\Auth\Events\Logout' => [
'App\Listeners\Auth\Logout',
],
//'Illuminate\Console\Events\ScheduledTaskStarting' => [
'Illuminate\Console\Events\CommandStarting' => [
'App\Listeners\Common\SkipScheduleInReadOnlyMode',
],
'App\Events\Auth\LandingPageShowing' => [
'App\Listeners\Auth\AddLandingPages',
],

View File

@ -66,6 +66,11 @@ class ViewComposer extends Provider
View::composer(
'layouts.wizard', 'App\Http\ViewComposers\Wizard'
);
View::composer(
['partials.admin.content'],
'App\Http\ViewComposers\ReadOnlyNotification'
);
}
/**