Boy132 af4cba341a
Add config option to disable server descriptions for users (#581)
* add config option to disable server descriptions

* only disable server descriptions for users but not for admins

* Add ,

* invert

* unset description in server transformer if disabled

* remove testing leftover

---------

Co-authored-by: notCharles <charles@pelican.dev>
2024-09-29 00:35:57 +02:00

35 lines
956 B
PHP

<?php
namespace App\Http\ViewComposers;
use App\Services\Helpers\AssetHashService;
use Illuminate\View\View;
class AssetComposer
{
/**
* AssetComposer constructor.
*/
public function __construct(private AssetHashService $assetHashService)
{
}
/**
* Provide access to the asset service in the views.
*/
public function compose(View $view): void
{
$view->with('asset', $this->assetHashService);
$view->with('siteConfiguration', [
'name' => config('app.name', 'Panel'),
'locale' => config('app.locale') ?? 'en',
'recaptcha' => [
'enabled' => config('recaptcha.enabled', false),
'siteKey' => config('recaptcha.website_key') ?? '',
],
'usesSyncDriver' => config('queue.default') === 'sync',
'serverDescriptionsEditable' => config('panel.editable_server_descriptions'),
]);
}
}