@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 = [ 'currencies' => 1, 'coupons' => 1, 'custom_domain' => 1, 'marketing' => 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, 'in_app_purchases' => 1, 'vcard_store' => 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 --}}
@csrf {{-- Card Body --}}
{{-- General --}}

{{ __('General Configuration Settings') }}

{{-- Website? --}}
{{ __('Turn on or off your website.') }}
{{-- Customer registration --}}
{{ __('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 --}}
{{-- Image Upload Limit --}}
{{ __('For example, if you want to limit the size to 5MB, set 5120') }}
{{-- Activate free plan during registeration --}}
{{ __('A free plan must exist if this option is enabled.') }}
{{-- Languages --}}
{{-- Website Settings --}}

{{ __('Website Settings') }}

{{-- 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 --}}
{{-- 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') }}
{{-- Card Footer --}}
{{-- Footer --}} @include('admin.includes.footer')
{{-- Custom JS --}} @section('scripts') @endsection @endsection