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

50
config/read-only.php Normal file
View File

@ -0,0 +1,50 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Flag to enable/disable read-only mode from the .env file
|--------------------------------------------------------------------------
*/
'enabled' => env('READ_ONLY_ENABLED', false),
/*
|--------------------------------------------------------------------------
| Enable read-only mode but still allow users to login
|--------------------------------------------------------------------------
*/
'allow_login' => env('READ_ONLY_LOGIN', true),
/*
|--------------------------------------------------------------------------
| The login/logout routes to allow if allow_login=true
|--------------------------------------------------------------------------
*/
'login_route' => 'login.store',
'logout_route' => 'logout',
/*
|--------------------------------------------------------------------------
| The request methods that you want to block
|--------------------------------------------------------------------------
*/
'methods' => explode(',', env('READ_ONLY_METHODS', 'post,put,patch,delete')),
/*
|--------------------------------------------------------------------------
| Whitelist certain request methods to certain routes
|--------------------------------------------------------------------------
*/
'whitelist' => [
// 'post' => 'dashboard',
],
/*
|--------------------------------------------------------------------------
| Skip livewire paths
|--------------------------------------------------------------------------
*/
'livewire' => explode(',', env('READ_ONLY_LIVEWIRE', 'common.search')),
];