update: add config

This commit is contained in:
tokumeikoi 2021-07-29 02:41:31 +09:00
parent de045c79f5
commit f409d89c4a
4 changed files with 15 additions and 1 deletions

View File

@ -21,6 +21,17 @@ class ConfigController extends Controller
]);
}
public function getThemeTemplate()
{
$path = public_path('theme/');
$files = array_map(function ($item) use ($path) {
return str_replace($path, '', $item);
}, glob($path . '*'));
return response([
'data' => $files
]);
}
public function setTelegramWebhook(Request $request)
{
$telegramService = new TelegramService($request->input('telegram_bot_token'));
@ -109,6 +120,7 @@ class ConfigController extends Controller
'epay_key' => config('v2board.epay_key'),
],
'frontend' => [
'frontend_theme' => config('v2board.frontend_theme', 'v2board'),
'frontend_theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
'frontend_theme_header' => config('v2board.frontend_theme_header', 'dark'),
'frontend_theme_color' => config('v2board.frontend_theme_color', 'default'),

View File

@ -85,6 +85,7 @@ class ConfigSave extends FormRequest
'epay_pid' => '',
'epay_key' => '',
// frontend
'frontend_theme' => '',
'frontend_theme_sidebar' => 'in:dark,light',
'frontend_theme_header' => 'in:dark,light',
'frontend_theme_color' => 'in:default,darkblue,black',

View File

@ -15,6 +15,7 @@ class AdminRoute
$router->get ('/config/fetch', 'Admin\\ConfigController@fetch');
$router->post('/config/save', 'Admin\\ConfigController@save');
$router->get ('/config/getEmailTemplate', 'Admin\\ConfigController@getEmailTemplate');
$router->get ('/config/getThemeTemplate', 'Admin\\ConfigController@getThemeTemplate');
$router->post('/config/setTelegramWebhook', 'Admin\\ConfigController@setTelegramWebhook');
// Plan
$router->get ('/plan/fetch', 'Admin\\PlanController@fetch');

View File

@ -23,6 +23,6 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->app['view']->addNamespace('theme', base_path() . '/public/theme');
$this->app['view']->addNamespace('theme', public_path() . '/theme');
}
}