@extends('admin.layouts.index', ['header' => true, 'nav' => true, 'demo' => true]) {{-- Custom CSS --}} @section('css') @endsection @php use Illuminate\Support\Facades\Auth; use App\Transaction; use Carbon\Carbon; // Fetch current user's details $user = Auth::user(); $allowedPermissions = json_decode($user->permissions, true); // Ensure `$allowedPermissions` is an array (to handle cases where permissions are null or malformed) if (!is_array($allowedPermissions)) { $allowedPermissions = []; } // Add or update missing permissions $defaultPermissions = [ 'coupons' => 1, 'custom_domain' => 1, 'marketing' => 1, 'maintenance_mode' => 1, 'demo_mode' => 1, 'backup' => 1, 'nfc_card_design' => 1, 'nfc_card_orders' => 1, 'nfc_card_order_transactions' => 1, 'nfc_card_key_generations' => 1, 'email_templates' => 1, 'plugins' => 1, 'referral_system' => 1, ]; // Merge default permissions with the current ones (current values take precedence) $allowedPermissions = array_merge($defaultPermissions, $allowedPermissions); // Update user details if permissions were changed if ($allowedPermissions !== json_decode($user->permissions, true)) { $user->permissions = json_encode($allowedPermissions); $user->updated_at = Carbon::now(); // Update timestamp explicitly $user->save(); // Save changes to the database } // Fetch updated permissions $allowedPermissions = json_decode($user->permissions, true); @endphp @section('content')
{{-- Failed --}} @if(Session::has("failed")) @endif {{-- Success --}} @if(Session::has("success")) @endif {{-- Settings --}}
{{-- General Configuration Settings --}}

@csrf
{{-- Show Website Frontend? --}}
{{ __('Turn on or off your website.') }}
{{-- Enable/disable registration page --}}
{{ __('Turn on or off registration page.') }}
{{-- Timezone --}}
{{-- Currency --}}
{{-- Currency format type --}}
{{-- Currency Decimals Places --}}
{{ __('If you don\'t need decimal vale, set 0')}}
{{-- Date Time Format --}}
{{-- Default Language --}}
{{-- Website Languages --}}
{{-- Default Plan Term Detting --}}

{{ __('Default Plan Term Settings') }}

{{-- Cookie Consent Settings --}}

{{ __('Cookie Consent Settings') }}

{{-- Image Upload Limit --}}

{{ __('Image Upload Limit') }}

{{ __('For example, if you want to limit the size to 5MB, set 5120')}}
{{-- Tiny Cloud API Key --}}

{{ __('Tiny Cloud (Text Editor) Configuration Settings') }}

{{ __('If you did not get a Tiny Cloud API Key, create a') }} {{ __('new API Key.') }}
{{-- Share Content Settings --}}

{{ __('Share Content Settings') }}

{{ __('Share Content') }}
{{ __('Available Short Codes') }}

{{ __('Use the following short codes in your content:') }}

  • { business_name } - {{ __('Business Name') }}
  • { business_url } - {{ __('Business URL or Address') }}
  • { appName } - {{ __('App Name') }}
{{-- Update button --}}
{{-- Website Configuration Settings --}}

@csrf
{{-- Theme Colors --}}
{{-- Themes Slider on/off in home page --}}
{{-- Home Banner Image --}}
{{ __('Banner Image') }}
{{ __('Recommended size : 1000 x 667') }}
{{-- Signup/Signin Image --}}
{{ __('Signup/Signin Image') }}
{{ __('Recommended size : 486 x 605') }}
{{-- Logo ({{ __('Dark') }}) --}}
{{ __('Logo') }} ({{ __('Dark') }})
{{ __('Recommended size : 200 x 90') }}
{{-- Logo ({{ __('Light') }}) --}}
{{ __('Logo') }} ({{ __('Light') }})
{{ __('Recommended size : 200 x 90') }}
{{-- Favicon --}}
{{ __('Favicon') }}
{{ __('Recommended size : 200 x 200') }}
{{-- App Name --}}
{{-- Site Name --}}
{{-- Additional Settings --}}

{{ __('Additional Settings') }}

{{-- Custom CSS --}}
{{-- Custom JS --}}
{{-- Update button --}}
{{-- Update Subdomain Settings --}}

@csrf
{{-- Enable subdomain in vcard and store? --}}

{{ __('Enable subdomain in vcard and store?') }}

{{-- Update button --}}
@if ($allowedPermissions['maintenance_mode']) {{-- Maintenance Mode --}}

@csrf
{{-- Maintenance Mode --}}
{{-- Message --}} @if (app()->isDownForMaintenance()) {{ __('The site is currently in maintenance mode.') }} @else {{ __('The site is currently not in maintenance mode.') }} @endif
{{-- Update button --}}
@endif
{{-- Footer --}} @include('admin.includes.footer')
{{-- Custom JS --}} @section('scripts') @endsection @endsection