mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-22 05:04:45 +02:00

* 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>
35 lines
956 B
PHP
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'),
|
|
]);
|
|
}
|
|
}
|