mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-05 18:23:48 +00:00
config refactoring
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="{{ $config->installation === 'installation-needed' ? 'dark:bg-dark-background bg-light-background' : '' }}" style="min-height: 100%" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<html class="{{ $config->app->installation === 'installation-needed' ? 'dark:bg-dark-background bg-light-background' : '' }}" style="min-height: 100%" lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta name="theme-color" content="{{ $config->app_color ?? '#00BC7E' }}">
|
||||
<meta name="theme-color" content="{{ $config->theme->color ?? '#00BC7E' }}">
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
|
||||
<meta name="description" content="{{ $config->app_description ?? __t('app_description') }}">
|
||||
<meta name="description" content="{{ $config->app->description ?? __t('app_description') }}">
|
||||
|
||||
<title>
|
||||
{{ $config->app_title ?? 'VueFileManager' }} | {{ $config->app_description ?? __t('app_description') }}
|
||||
{{ $config->app->title ?? 'VueFileManager' }} | {{ $config->app->description ?? __t('app_description') }}
|
||||
</title>
|
||||
|
||||
{{--StyleSheet--}}
|
||||
@@ -18,18 +18,18 @@
|
||||
|
||||
{{--OG items--}}
|
||||
<meta property="og:url" content="{{ url('/') }}">
|
||||
<meta property="og:title" content="{{ $config->app_title ?? 'VueFileManager' }} | {{ $config->app_description ?? __t('app_description') }}">
|
||||
<meta property="og:description" content="{{ $config->app_description ?? __t('app_description') }}">
|
||||
<meta property="og:image" content="{{ isset($config->app_og_image) ? url($config->app_og_image) : '' }}">
|
||||
<meta property="og:title" content="{{ $config->app->title ?? 'VueFileManager' }} | {{ $config->app->description ?? __t('app_description') }}">
|
||||
<meta property="og:description" content="{{ $config->app->description ?? __t('app_description') }}">
|
||||
<meta property="og:image" content="{{ isset($config->logos->og_image) ? url($config->logos->og_image) : '' }}">
|
||||
|
||||
{{-- Apple Mobile Web App--}}
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="white">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $config->app_title ?? 'VueFileManager' }}">
|
||||
<meta name="apple-mobile-web-app-title" content="{{ $config->app->title ?? 'VueFileManager' }}">
|
||||
|
||||
{{--Icons--}}
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ isset($config->app_touch_icon) ? url($config->app_touch_icon) : '' }}">
|
||||
<link rel="icon" href="{{ isset($config->app_favicon) ? url($config->app_favicon) : asset('favicon.png') }}?v={{ get_version() }}">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="{{ isset($config->logos->touch_icon) ? url($config->logos->touch_icon) : '' }}">
|
||||
<link rel="icon" href="{{ isset($config->logos->favicon) ? url($config->logos->favicon) : asset('favicon.png') }}?v={{ get_version() }}">
|
||||
|
||||
{{--Format Detection--}}
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
@@ -43,112 +43,112 @@
|
||||
|
||||
<script>
|
||||
let config = {
|
||||
host: '{{ $config->host }}',
|
||||
api: '{{ $config->api }}',
|
||||
locale: '{{ $config->locale }}',
|
||||
host: '{{ $config->app->host }}',
|
||||
api: '{{ $config->app->api }}',
|
||||
locale: '{{ $config->app->locale }}',
|
||||
|
||||
broadcasting: '{{ $config->broadcasting }}',
|
||||
broadcastingKey: '{{ $config->broadcastingKey }}',
|
||||
broadcastingHost: '{{ $config->broadcastingHost }}',
|
||||
broadcastingPort: '{{ $config->broadcastingPort }}',
|
||||
broadcastingCluster: '{{ $config->broadcastingCluster }}',
|
||||
broadcasting: '{{ $config->broadcasting->driver }}',
|
||||
broadcastingKey: '{{ $config->broadcasting->key }}',
|
||||
broadcastingHost: '{{ $config->broadcasting->host }}',
|
||||
broadcastingPort: '{{ $config->broadcasting->port }}',
|
||||
broadcastingCluster: '{{ $config->broadcasting->cluster }}',
|
||||
|
||||
app_logo: '{{ $config->app_logo }}',
|
||||
app_logo_dark: '{{ $config->app_logo_dark }}',
|
||||
app_logo_horizontal: '{{ $config->app_logo_horizontal }}',
|
||||
app_logo_horizontal_dark: '{{ $config->app_logo_horizontal_dark }}',
|
||||
app_logo: '{{ $config->logos->main }}',
|
||||
app_logo_dark: '{{ $config->logos->main_dark }}',
|
||||
app_logo_horizontal: '{{ $config->logos->horizontal }}',
|
||||
app_logo_horizontal_dark: '{{ $config->logos->horizontal_dark }}',
|
||||
|
||||
app_color: '{{ $config->app_color }}',
|
||||
app_footer: '{!! $config->app_footer !!}',
|
||||
app_name: '{{ $config->app_name }}',
|
||||
app_description: '{{ $config->app_description }}',
|
||||
app_color: '{{ $config->theme->color }}',
|
||||
app_footer: '{!! $config->app->footer !!}',
|
||||
app_name: '{{ $config->app->name }}',
|
||||
app_description: '{{ $config->app->description }}',
|
||||
|
||||
allowHomepage: {{ $config->allowHomepage }},
|
||||
storageLimit: {{ $config->storageLimit }},
|
||||
storageLimit: {{ $config->storage->limit }},
|
||||
teamsDefaultMembers: {{ $config->teamsDefaultMembers }},
|
||||
storageDefaultSpace: {{ $config->storageDefaultSpace }},
|
||||
storageDefaultSpaceFormatted: '{{ $config->storageDefaultSpaceFormatted }}',
|
||||
mimetypesBlacklist: '{{ $config->mimetypesBlacklist }}',
|
||||
uploadLimit: {{ $config->uploadLimit }},
|
||||
uploadLimitFormatted: '{{ $config->uploadLimitFormatted }}',
|
||||
chunkSize: {{ $config->chunkSize }},
|
||||
storageDefaultSpace: {{ $config->storage->defaultSpace }},
|
||||
storageDefaultSpaceFormatted: '{{ $config->storage->defaultSpaceFormatted }}',
|
||||
mimetypesBlacklist: '{{ $config->upload->disabledMimetypes }}',
|
||||
uploadLimit: {{ $config->upload->limit }},
|
||||
uploadLimitFormatted: '{{ $config->upload->limitFormatted }}',
|
||||
chunkSize: {{ $config->upload->chunkSize }},
|
||||
|
||||
isAuthenticated: {{ $config->isAuthenticated }},
|
||||
isSaaS: {{ $config->isSaaS }},
|
||||
isAuthenticated: {{ $config->app->isAuthenticated }},
|
||||
isSaaS: {{ $config->app->isSaaS }},
|
||||
|
||||
isDev: {{ $config->isDev }},
|
||||
isDemo: {{ $config->isDemo }},
|
||||
isDev: {{ $config->app->isDev }},
|
||||
isDemo: {{ $config->app->isDemo }},
|
||||
|
||||
legal: {!! $config->legal !!},
|
||||
|
||||
installation: '{{ $config->installation }}',
|
||||
statusCheck: {!! $config->statusCheck !!},
|
||||
isSetupWizardDemo: {{ $config->isSetupWizardDemo }},
|
||||
isSetupWizardDebug: {{ $config->isSetupWizardDebug }},
|
||||
installation: '{{ $config->app->installation }}',
|
||||
statusCheck: {!! $config->debug->statusCheck !!},
|
||||
isSetupWizardDemo: {{ $config->debug->isSetupWizardDemo }},
|
||||
isSetupWizardDebug: {{ $config->debug->isSetupWizardDebug }},
|
||||
|
||||
// States
|
||||
isEmptyPlans: {{ $config->isEmptyPlans }},
|
||||
isEmptyTransactions: {{ $config->isEmptyTransactions }},
|
||||
isEmptySubscriptions: {{ $config->isEmptySubscriptions }},
|
||||
isEmptyPlans: {{ $config->payments->isEmptyPlans }},
|
||||
isEmptyTransactions: {{ $config->payments->isEmptyTransactions }},
|
||||
isEmptySubscriptions: {{ $config->payments->isEmptySubscriptions }},
|
||||
|
||||
// Hidden set ups
|
||||
isAdminVueFileManagerBar: {{ $config->isAdminVueFileManagerBar }},
|
||||
isAdminVueFileManagerBar: {{ $config->debug->isAdminVueFileManagerBar }},
|
||||
|
||||
// Metered
|
||||
allowed_registration_bonus: {{ $config->allowed_registration_bonus }},
|
||||
registration_bonus_amount: {{ $config->registration_bonus_amount }},
|
||||
isCreatedMeteredPlan: {{ $config->isCreatedMeteredPlan }},
|
||||
meteredPlanId: '{{ $config->meteredPlanId }}',
|
||||
allowed_registration_bonus: {{ $config->billing_metered->allowed_registration_bonus }},
|
||||
registration_bonus_amount: {{ $config->billing_metered->registration_bonus_amount }},
|
||||
isCreatedMeteredPlan: {{ $config->billing_metered->isCreatedMeteredPlan }},
|
||||
meteredPlanId: '{{ $config->billing_metered->meteredPlanId }}',
|
||||
|
||||
// Payments
|
||||
allowed_payments: {{ $config->allowed_payments }},
|
||||
subscriptionType: '{{ $config->subscriptionType }}',
|
||||
allowed_payments: {{ $config->payments->allowed }},
|
||||
subscriptionType: '{{ $config->payments->type }}',
|
||||
|
||||
// PayPal
|
||||
isPayPal: {{ $config->isPayPal }},
|
||||
isPayPalLive: {{ $config->isPayPalLive }},
|
||||
paypal_client_id: '{{ $config->paypal_client_id }}',
|
||||
paypal_payment_description: '{{ $config->paypal_payment_description }}',
|
||||
isPayPal: {{ $config->gateways->paypal->allowed }},
|
||||
isPayPalLive: {{ $config->gateways->paypal->live }},
|
||||
paypal_client_id: '{{ $config->gateways->paypal->client_id }}',
|
||||
paypal_payment_description: '{{ $config->gateways->paypal->payment_description }}',
|
||||
|
||||
// Paystack
|
||||
isPaystack: {{ $config->isPaystack }},
|
||||
paystack_public_key: '{{ $config->paystack_public_key }}',
|
||||
paystack_payment_description: '{{ $config->paystack_payment_description }}',
|
||||
isPaystack: {{ $config->gateways->paystack->allowed }},
|
||||
paystack_public_key: '{{ $config->gateways->paystack->public_key }}',
|
||||
paystack_payment_description: '{{ $config->gateways->paystack->payment_description }}',
|
||||
|
||||
// Stripe
|
||||
isStripe: {{ $config->isStripe }},
|
||||
stripe_public_key: '{{ $config->stripe_public_key }}',
|
||||
stripe_payment_description: '{{ $config->stripe_payment_description }}',
|
||||
isStripe: {{ $config->gateways->stripe->allowed }},
|
||||
stripe_public_key: '{{ $config->gateways->stripe->public_key }}',
|
||||
stripe_payment_description: '{{ $config->gateways->stripe->payment_description }}',
|
||||
|
||||
// ReCaptcha
|
||||
recaptcha_client_id: '{{ $config->recaptcha_client_id }}',
|
||||
allowedRecaptcha: {{ $config->allowedRecaptcha }},
|
||||
isRecaptchaConfigured: {{ $config->isRecaptchaConfigured }},
|
||||
recaptcha_client_id: '{{ $config->recaptcha->client_id }}',
|
||||
allowedRecaptcha: {{ $config->recaptcha->allowed }},
|
||||
isRecaptchaConfigured: {{ $config->recaptcha->is_configured }},
|
||||
|
||||
// Social logins
|
||||
allowedFacebookLogin: {{ $config->allowedFacebookLogin }},
|
||||
isFacebookLoginConfigured: {{ $config->isFacebookLoginConfigured }},
|
||||
allowedFacebookLogin: {{ $config->social_logins->is_facebook_allowed }},
|
||||
isFacebookLoginConfigured: {{ $config->social_logins->is_facebook_configured }},
|
||||
|
||||
allowedGoogleLogin: {{ $config->allowedGoogleLogin }},
|
||||
isGoogleLoginConfigured: {{ $config->isGoogleLoginConfigured }},
|
||||
allowedGoogleLogin: {{ $config->social_logins->is_google_allowed }},
|
||||
isGoogleLoginConfigured: {{ $config->social_logins->is_google_configured }},
|
||||
|
||||
allowedGithubLogin: {{ $config->allowedGithubLogin }},
|
||||
isGithubLoginConfigured: {{ $config->isGithubLoginConfigured }},
|
||||
allowedGithubLogin: {{ $config->social_logins->is_github_allowed }},
|
||||
isGithubLoginConfigured: {{ $config->social_logins->is_github_configured }},
|
||||
|
||||
// Adsense
|
||||
allowedAdsense: {{ $config->allowedAdsense }},
|
||||
adsenseClientId: '{{ $config->adsenseClientId }}',
|
||||
adsenseBanner01: `{!! $config->adsenseBanner01 !!}`,
|
||||
adsenseBanner02: `{!! $config->adsenseBanner02 !!}`,
|
||||
adsenseBanner03: `{!! $config->adsenseBanner03 !!}`,
|
||||
allowedAdsense: {{ $config->adsense->allowed }},
|
||||
adsenseClientId: '{{ $config->adsense->clientId }}',
|
||||
adsenseBanner01: `{!! $config->adsense->banner01 !!}`,
|
||||
adsenseBanner02: `{!! $config->adsense->banner02 !!}`,
|
||||
adsenseBanner03: `{!! $config->adsense->banner03 !!}`,
|
||||
|
||||
// User settings
|
||||
defaultEmoji: '{{ $config->defaultEmoji }}',
|
||||
defaultThemeMode: '{{ $config->defaultThemeMode }}',
|
||||
defaultEmoji: '{{ $config->theme->emoji }}',
|
||||
defaultThemeMode: '{{ $config->theme->mode }}',
|
||||
|
||||
// App settings
|
||||
userRegistration: {{ $config->userRegistration }},
|
||||
userVerification: {{ $config->userVerification }},
|
||||
userRegistration: {{ $config->registration->allowed }},
|
||||
userVerification: {{ $config->registration->verification }},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Settings\Actions;
|
||||
|
||||
use DB;
|
||||
@@ -14,7 +15,8 @@ class GetConfigAction
|
||||
{
|
||||
public function __construct(
|
||||
public GetServerStatusController $getServerSetupStatus,
|
||||
) {
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
public function __invoke(): array
|
||||
@@ -88,105 +90,117 @@ class GetConfigAction
|
||||
}
|
||||
|
||||
return [
|
||||
// App
|
||||
'host' => url('/'),
|
||||
'api' => url('/api'),
|
||||
'locale' => app()->getLocale(),
|
||||
'isDev' => is_dev() ? 1 : 0,
|
||||
'isDemo' => config('vuefilemanager.is_demo') ? 1 : 0,
|
||||
'isSaaS' => $settings && optional($settings)->license === 'extended' ? 1 : 0,
|
||||
'isAuthenticated' => $isUser ? 1 : 0,
|
||||
'isSetupWizardDemo' => config('vuefilemanager.is_setup_wizard_demo') ? 1 : 0,
|
||||
'isSetupWizardDebug' => config('vuefilemanager.is_setup_wizard_debug') ? 1 : 0,
|
||||
'isAdminVueFileManagerBar' => config('vuefilemanager.is_admin_vuefilemanager_bar', 1) ? 1 : 0,
|
||||
'installation' => $setupStatus ?? 'initial',
|
||||
'statusCheck' => json_encode($serverInfo) ?? 'undefined',
|
||||
|
||||
// Broadcasting
|
||||
'broadcasting' => config('broadcasting.default'),
|
||||
'broadcastingKey' => config('broadcasting.connections.pusher.key'),
|
||||
'broadcastingHost' => config('broadcasting.connections.pusher.options.host'),
|
||||
'broadcastingPort' => config('broadcasting.connections.pusher.options.port'),
|
||||
'broadcastingCluster' => config('broadcasting.connections.pusher.options.cluster'),
|
||||
|
||||
// App Logos
|
||||
'app_logo' => $settings->app_logo ?? null,
|
||||
'app_logo_dark' => $settings->app_logo_dark ?? null,
|
||||
'app_logo_horizontal' => $settings->app_logo_horizontal ?? null,
|
||||
'app_logo_horizontal_dark' => $settings->app_logo_horizontal_dark ?? null,
|
||||
|
||||
// App theme
|
||||
'app_color' => $settings->app_color ?? '#00BC7E',
|
||||
'app_footer' => $settings->footer_content ?? null,
|
||||
|
||||
// App title & name
|
||||
'app_name' => $settings->app_title ?? 'VueFileManager',
|
||||
'app_description' => $settings->app_description ?? __t('app_description'),
|
||||
'defaultEmoji' => $defaultEmoji,
|
||||
'defaultThemeMode' => $defaultThemeMode,
|
||||
|
||||
// Upload settings
|
||||
'mimetypesBlacklist' => isset($settings->mimetypes_blacklist) ? $settings->mimetypes_blacklist : null,
|
||||
'storageDefaultSpace' => $settings->default_max_storage_amount ?? 5,
|
||||
'storageLimit' => $settings->storage_limitation ?? 1,
|
||||
'storageDefaultSpaceFormatted' => $storageDefaultSpaceFormatted,
|
||||
'uploadLimitFormatted' => $uploadLimitFormatted,
|
||||
'uploadLimit' => $uploadLimit,
|
||||
'chunkSize' => $chunkSize,
|
||||
|
||||
// Metered billings
|
||||
'allowed_registration_bonus' => $settings->allowed_registration_bonus ?? 0,
|
||||
'registration_bonus_amount' => $settings->registration_bonus_amount ?? 0,
|
||||
'isCreatedMeteredPlan' => $plan && $plan->exists() ? 1 : 0,
|
||||
'meteredPlanId' => $plan && $plan->exists() ? $plan->first()->id : null,
|
||||
|
||||
// Payments setup
|
||||
'allowed_payments' => $settings->allowed_payments ?? 0,
|
||||
'subscriptionType' => $settings->subscription_type ?? 'none',
|
||||
'isEmptyPlans' => $isEmptyPlans ? 1 : 0,
|
||||
'isEmptyTransactions' => $isEmptyTransactions ? 1 : 0,
|
||||
'isEmptySubscriptions' => $isEmptySubscriptions ? 1 : 0,
|
||||
|
||||
// Payment gateways
|
||||
'isPayPal' => $settings->allowed_paypal ?? 0,
|
||||
'isPaystack' => $settings->allowed_paystack ?? 0,
|
||||
'isStripe' => $settings->allowed_stripe ?? 0,
|
||||
'isPayPalLive' => config('subscription.credentials.paypal.is_live') ? 1 : 0,
|
||||
'paypal_client_id' => config('subscription.credentials.paypal.id'),
|
||||
'paystack_public_key' => config('subscription.credentials.paystack.public_key'),
|
||||
'stripe_public_key' => config('subscription.credentials.stripe.public_key'),
|
||||
'paypal_payment_description' => $settings->paypal_payment_description ?? null,
|
||||
'paystack_payment_description' => $settings->paystack_payment_description ?? null,
|
||||
'stripe_payment_description' => $settings->stripe_payment_description ?? null,
|
||||
|
||||
// Google reCaptcha
|
||||
'allowedRecaptcha' => $settings->allowed_recaptcha ?? 0,
|
||||
'recaptcha_client_id' => config('services.recaptcha.client_id'),
|
||||
'isRecaptchaConfigured' => config('services.recaptcha.client_id') ? 1 : 0,
|
||||
|
||||
// Social Authentication
|
||||
'allowedFacebookLogin' => $settings->allowed_facebook_login ?? 0,
|
||||
'allowedGoogleLogin' => $settings->allowed_google_login ?? 0,
|
||||
'allowedGithubLogin' => $settings->allowed_github_login ?? 0,
|
||||
'isFacebookLoginConfigured' => config('services.facebook.client_id') ? 1 : 0,
|
||||
'isGoogleLoginConfigured' => config('services.google.client_id') ? 1 : 0,
|
||||
'isGithubLoginConfigured' => config('services.github.client_id') ? 1 : 0,
|
||||
|
||||
// Google Adsense
|
||||
'allowedAdsense' => $settings?->allowed_adsense ?? 0,
|
||||
'adsenseClientId' => $settings->adsense_client_id ?? null,
|
||||
'adsenseBanner01' => $settings->adsense_banner_01 ?? null,
|
||||
'adsenseBanner02' => $settings->adsense_banner_02 ?? null,
|
||||
'adsenseBanner03' => $settings->adsense_banner_03 ?? null,
|
||||
|
||||
// Registration
|
||||
'userRegistration' => $settings->registration ?? 1,
|
||||
'userVerification' => $settings->user_verification ?? 0,
|
||||
'app' => [
|
||||
'host' => url('/'),
|
||||
'api' => url('/api'),
|
||||
'locale' => app()->getLocale(),
|
||||
'isDev' => is_dev() ? 1 : 0,
|
||||
'isDemo' => config('vuefilemanager.is_demo') ? 1 : 0,
|
||||
'isSaaS' => $settings && optional($settings)->license === 'extended' ? 1 : 0,
|
||||
'isAuthenticated' => $isUser ? 1 : 0,
|
||||
'installation' => $setupStatus ?? 'initial',
|
||||
'name' => $settings->app_title ?? 'VueFileManager',
|
||||
'description' => $settings->app_description ?? __t('app_description'),
|
||||
'footer' => $settings->footer_content ?? null,
|
||||
],
|
||||
'debug' => [
|
||||
'isSetupWizardDemo' => config('vuefilemanager.is_setup_wizard_demo') ? 1 : 0,
|
||||
'isSetupWizardDebug' => config('vuefilemanager.is_setup_wizard_debug') ? 1 : 0,
|
||||
'isAdminVueFileManagerBar' => config('vuefilemanager.is_admin_vuefilemanager_bar', 1) ? 1 : 0,
|
||||
'statusCheck' => json_encode($serverInfo) ?? 'undefined',
|
||||
],
|
||||
'broadcasting' => [
|
||||
'driver' => config('broadcasting.default'),
|
||||
'key' => config('broadcasting.connections.pusher.key'),
|
||||
'host' => config('broadcasting.connections.pusher.options.host'),
|
||||
'port' => config('broadcasting.connections.pusher.options.port'),
|
||||
'cluster' => config('broadcasting.connections.pusher.options.cluster'),
|
||||
],
|
||||
'logos' => [
|
||||
'main' => $settings->app_logo ?? null,
|
||||
'og_image' => $settings->app_og_image ?? null,
|
||||
'main_dark' => $settings->app_logo_dark ?? null,
|
||||
'horizontal' => $settings->app_logo_horizontal ?? null,
|
||||
'horizontal_dark' => $settings->app_logo_horizontal_dark ?? null,
|
||||
'touch_icon' => $settings->app_touch_icon ?? null,
|
||||
'favicon' => $settings->app_favicon ?? null,
|
||||
],
|
||||
'theme' => [
|
||||
'color' => $settings->app_color ?? '#00BC7E',
|
||||
'emoji' => $defaultEmoji,
|
||||
'mode' => $defaultThemeMode,
|
||||
],
|
||||
'upload' => [
|
||||
'disabledMimetypes' => isset($settings->mimetypes_blacklist) ? $settings->mimetypes_blacklist : null,
|
||||
'limit' => $uploadLimit,
|
||||
'chunkSize' => $chunkSize,
|
||||
'limitFormatted' => $uploadLimitFormatted,
|
||||
],
|
||||
'storage' => [
|
||||
'defaultSpace' => intval($settings->default_max_storage_amount ?? 5),
|
||||
'limit' => intval($settings->storage_limitation ?? 1),
|
||||
'defaultSpaceFormatted' => $storageDefaultSpaceFormatted,
|
||||
],
|
||||
'billing_metered' => [
|
||||
'allowed_registration_bonus' => intval($settings->allowed_registration_bonus ?? 0),
|
||||
'registration_bonus_amount' => intval($settings->registration_bonus_amount ?? 0),
|
||||
'isCreatedMeteredPlan' => $plan && $plan->exists() ? 1 : 0,
|
||||
'meteredPlanId' => $plan && $plan->exists() ? $plan->first()->id : null,
|
||||
],
|
||||
'payments' => [
|
||||
'allowed' => intval($settings->allowed_payments ?? 0),
|
||||
'type' => $settings->subscription_type ?? 'none',
|
||||
'isEmptyPlans' => $isEmptyPlans ? 1 : 0,
|
||||
'isEmptyTransactions' => $isEmptyTransactions ? 1 : 0,
|
||||
'isEmptySubscriptions' => $isEmptySubscriptions ? 1 : 0,
|
||||
],
|
||||
'gateways' => [
|
||||
'paypal' => [
|
||||
'allowed' => intval($settings->allowed_paypal ?? 0),
|
||||
'live' => config('subscription.credentials.paypal.is_live') ? 1 : 0,
|
||||
'client_id' => config('subscription.credentials.paypal.id'),
|
||||
'payment_description' => $settings->paypal_payment_description ?? null,
|
||||
],
|
||||
'stripe' => [
|
||||
'allowed' => intval($settings->allowed_stripe ?? 0),
|
||||
'public_key' => config('subscription.credentials.stripe.public_key'),
|
||||
'payment_description' => $settings->stripe_payment_description ?? null,
|
||||
],
|
||||
'paystack' => [
|
||||
'allowed' => intval($settings->allowed_paystack ?? 0),
|
||||
'public_key' => config('subscription.credentials.paystack.public_key'),
|
||||
'payment_description' => $settings->paystack_payment_description ?? null,
|
||||
],
|
||||
],
|
||||
'recaptcha' => [
|
||||
'allowed' => intval($settings->allowed_recaptcha ?? 0),
|
||||
'is_configured' => config('services.recaptcha.client_id') ? 1 : 0,
|
||||
'client_id' => config('services.recaptcha.client_id'),
|
||||
],
|
||||
'social_logins' => [
|
||||
'is_facebook_allowed' => $settings->allowed_facebook_login ?? 0,
|
||||
'is_google_allowed' => $settings->allowed_google_login ?? 0,
|
||||
'is_github_allowed' => $settings->allowed_github_login ?? 0,
|
||||
'is_facebook_configured' => config('services.facebook.client_id') ? 1 : 0,
|
||||
'is_google_configured' => config('services.google.client_id') ? 1 : 0,
|
||||
'is_github_configured' => config('services.github.client_id') ? 1 : 0,
|
||||
],
|
||||
'adsense' => [
|
||||
'allowed' => intval($settings?->allowed_adsense ?? 0),
|
||||
'clientId' => $settings->adsense_client_id ?? null,
|
||||
'banner01' => $settings->adsense_banner_01 ?? null,
|
||||
'banner02' => $settings->adsense_banner_02 ?? null,
|
||||
'banner03' => $settings->adsense_banner_03 ?? null,
|
||||
],
|
||||
'registration' => [
|
||||
'allowed' => $settings->registration ?? 1,
|
||||
'verification' => $settings->user_verification ?? 0,
|
||||
],
|
||||
|
||||
// Public Pages
|
||||
'allowHomepage' => $settings->allow_homepage ?? 1,
|
||||
'teamsDefaultMembers' => $settings->default_max_team_member ?? 10,
|
||||
'legal' => $pages ? json_encode($pages) : 'undefined',
|
||||
'allowHomepage' => intval($settings->allow_homepage ?? 1),
|
||||
'teamsDefaultMembers' => intval($settings->default_max_team_member ?? 10),
|
||||
'legal' => $pages ? json_encode($pages) : 'undefined',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user