@extends('layouts.admin') @section('title','General Settings') @push('styles') @endpush @section('content') @php use Illuminate\Support\Facades\Schema; $get = fn($k) => data_get($config ?? [], $k); $mailDefaults = $mailDefaults ?? []; $columnsFromController = isset($dbFields) && is_array($dbFields) ? $dbFields : (Schema::hasTable('configs') ? Schema::getColumnListing('configs') : []); $onlyDb = fn(array $items) => array_values(array_filter($items, fn($it) => in_array($it['k'], $columnsFromController, true))); $site = [ ['k'=>'site_name','label'=>'Site Name','type'=>'text','desc'=>'Full name of your LMS'], ['k'=>'site_shortname','label'=>'Short Name','type'=>'text','desc'=>'Abbreviation used in menus'], ['k'=>'site_url','label'=>'Site URL','type'=>'url','desc'=>'Base URL of your application'], ['k'=>'email','label'=>'Contact Email','type'=>'email','desc'=>'Primary contact email'], ['k'=>'timezone','label'=>'Timezone','type'=>'select','desc'=>'Site timezone','options'=>[ 'UTC'=>'UTC','America/New_York'=>'Eastern Time','America/Chicago'=>'Central Time','America/Denver'=>'Mountain Time', 'America/Los_Angeles'=>'Pacific Time','Europe/London'=>'London','Asia/Singapore'=>'Singapore','Asia/Tokyo'=>'Tokyo' ]], ['k'=>'date_format','label'=>'Date Format','type'=>'select','desc'=>'Display format for dates','options'=>[ 'd/m/Y'=>'DD/MM/YYYY','m/d/Y'=>'MM/DD/YYYY','Y-m-d'=>'YYYY-MM-DD','d-m-Y'=>'DD-MM-YYYY' ]], ['k'=>'time_format','label'=>'Time Format','type'=>'select','desc'=>'Display format for time','options'=>['12'=>'12 Hour','24'=>'24 Hour']], ]; $email = [ ['k'=>'mail_host','label'=>'SMTP Host','type'=>'text','desc'=>'Email server hostname (e.g., smtp.gmail.com)'], ['k'=>'mail_port','label'=>'SMTP Port','type'=>'number','desc'=>'Email server port (usually 587 for TLS)'], ['k'=>'mail_username','label'=>'SMTP Username','type'=>'text','desc'=>'Email server username/email address'], ['k'=>'mail_from_name','label'=>'From Name','type'=>'text','desc'=>'Default sender name for system emails'], ['k'=>'mail_encryption','label'=>'Encryption','type'=>'select','desc'=>'Email encryption method','options'=>['none'=>'None','tls'=>'TLS','ssl'=>'SSL']], ['k'=>'mail_from_address','label'=>'From Email Address','type'=>'email','desc'=>'Default sender email address'], ]; $colors = [ ['k'=>'main_color','label'=>'Primary Color','type'=>'color','desc'=>'Main brand color for buttons and links'], ['k'=>'secondary_color','label'=>'Secondary Color','type'=>'color','desc'=>'Accent color for highlights and warnings'], ['k'=>'tertiary_color','label'=>'Tertiary Color','type'=>'color','desc'=>'Success and positive actions'], ['k'=>'success_color','label'=>'Success Color','type'=>'color','desc'=>'Success messages and confirmations'], ['k'=>'error_color','label'=>'Error Color','type'=>'color','desc'=>'Error messages and warnings'], ['k'=>'warning_color','label'=>'Warning Color','type'=>'color','desc'=>'Warning messages and cautions'], ['k'=>'info_color','label'=>'Info Color','type'=>'color','desc'=>'Informational messages'], ['k'=>'black_color','label'=>'Dark Color','type'=>'color','desc'=>'Dark text and backgrounds'], ['k'=>'white_color','label'=>'Light Color','type'=>'color','desc'=>'Light text and backgrounds'], ]; $typography = [ ['k'=>'primary_font','label'=>'Primary Font','type'=>'text','desc'=>'Main font family for body text'], ['k'=>'secondary_font','label'=>'Secondary Font','type'=>'text','desc'=>'Font family for headings and accents'], ['k'=>'body_font_size','label'=>'Body Font Size','type'=>'text','desc'=>'Base font size (e.g., 16px)'], ['k'=>'h1_font_size','label'=>'H1 Font Size','type'=>'text','desc'=>'Large heading size'], ['k'=>'h2_font_size','label'=>'H2 Font Size','type'=>'text','desc'=>'Medium heading size'], ['k'=>'h3_font_size','label'=>'H3 Font Size','type'=>'text','desc'=>'Small heading size'], ['k'=>'h4_font_size','label'=>'H4 Font Size','type'=>'text','desc'=>'Extra small heading size'], ['k'=>'h5_font_size','label'=>'H5 Font Size','type'=>'text','desc'=>'Minimal heading size'], ['k'=>'body_line_height','label'=>'Body Line Height','type'=>'text','desc'=>'Line spacing for body text (e.g., 1.5)'], ['k'=>'heading_line_height','label'=>'Heading Line Height','type'=>'text','desc'=>'Line spacing for headings (e.g., 1.2)'], ['k'=>'font_weight_normal','label'=>'Normal Weight','type'=>'text','desc'=>'Regular text weight (e.g., 400)'], ['k'=>'font_weight_medium','label'=>'Medium Weight','type'=>'text','desc'=>'Medium text weight (e.g., 500)'], ['k'=>'font_weight_bold','label'=>'Bold Weight','type'=>'text','desc'=>'Bold text weight (e.g., 600)'], ]; $layout = [ ['k'=>'border_radius','label'=>'Border Radius','type'=>'text','desc'=>'Corner roundness (e.g., 8px)'], ['k'=>'sidebar_width','label'=>'Sidebar Width','type'=>'text','desc'=>'Admin sidebar width (e.g., 280px)'], ['k'=>'content_max_width','label'=>'Content Max Width','type'=>'text','desc'=>'Maximum content area width (e.g., 1400px)'], ]; $learning = [ // Removed number_of_teaching_days as requested ['k'=>'questions_per_test','label'=>'Questions Per Test','type'=>'number','min'=>1,'max'=>100], ['k'=>'no_rights_to_pass','label'=>'Rights Needed to Pass','type'=>'number','min'=>1,'max'=>10], ['k'=>'no_wrongs_to_fail','label'=>'Wrongs to Fail','type'=>'number','min'=>1,'max'=>10], ]; // Hide any fields not in DB $site = $onlyDb($site); $email = $onlyDb($email); $colors = $onlyDb($colors); $typography = $onlyDb($typography); $layout = $onlyDb($layout); $learning = $onlyDb($learning); @endphp

General Settings

Click any value to edit and hit Enter to save.
{{-- Site --}}
Basic Site Settings
@foreach($site as $it) @php $k=$it['k']; $type=$it['type']; $val = old($k, $get($k)); @endphp
{{ $val }} @if($type==='select') @elseif($type==='textarea') @else @endif Saved Error
@if(!empty($it['desc'] ?? null))
{{ $it['desc'] }}
@endif
@endforeach
{{-- Visual Assets card in resources/views/admin/settings/general.blade.php --}}
Visual Assets
{{-- Logo --}}
@php $logoPath = $get('site_logo'); $logoUrl = $logoPath ? asset($logoPath) . '?v=' . ($assetVersion ?? time()) : null; @endphp @if($logoPath && file_exists(public_path($logoPath)))
Logo
@else @endif
{{-- Favicon --}}
@php $faviconPath = $get('favicon'); $faviconUrl = $faviconPath ? asset($faviconPath) . '?v=' . ($assetVersion ?? time()) : null; @endphp @if($faviconPath && file_exists(public_path($faviconPath)))
Favicon
@else
16×16 or 32×32 px recommended
@endif
{{-- Login background --}}
1920×1080 px recommended
{{-- row --}}
{{-- /site --}} {{-- Email --}}
SMTP Email Configuration
@foreach($email as $it) @php $k = $it['k']; $type= $it['type']; // show DB value or .env/config() fallback $val = old($k, $get($k) ?? data_get($mailDefaults, $k)); @endphp
{{ $val }} @if(($it['type'] ?? '') === 'select') @else @endif Saved Error
@if(!empty($it['desc'] ?? null))
{{ $it['desc'] }}
@endif
@endforeach
Note: SMTP password stays in server config/env.
Email Test

Send a quick test email.

{{-- row --}}
{{-- /email --}} {{-- Theme --}}
Colors
@foreach($colors as $it) @php $k=$it['k']; $type=$it['type']; $val = old($k, $get($k)); @endphp
{{ $val }} Saved Error
@if(!empty($it['desc'] ?? null))
{{ $it['desc'] }}
@endif
@endforeach
Layout
@foreach($layout as $it) @php $k=$it['k']; $type=$it['type']; $val = old($k, $get($k)); @endphp
{{ $val }} Saved Error
@if(!empty($it['desc'] ?? null))
{{ $it['desc'] }}
@endif
@endforeach
Typography
@foreach($typography as $it) @php $k=$it['k']; $type=$it['type']; $val = old($k, $get($k)); @endphp
{{ $val }} Saved Error
@if(!empty($it['desc'] ?? null))
{{ $it['desc'] }}
@endif
@endforeach
{{-- row --}}
{{-- /theme --}} {{-- Learning --}}
Learning Settings
@foreach($learning as $it) @php $k=$it['k']; $type=$it['type']; $val = old($k, $get($k)); @endphp
{{ $val }} Saved Error
@endforeach
Feature Toggles
Allow students to learn at their own pace
{{-- row --}}
{{-- /learning --}} {{-- System --}}
Maintenance
Put the site in maintenance mode
@php $k='maintenance_message'; $val = old($k, $get($k)); @endphp
{{ $val }} Saved Error
{{-- /system --}}
{{-- /tab-content --}}
Configuration Test Results
@endsection @push('scripts') @endpush