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