@extends('layouts.app') @section('title', 'System Settings') @section('page_title', 'Configuration & Backups') @section('content')
Application Configuration
@csrf @method('PUT') @foreach($settings as $group => $items)
{{ strtoupper($group) }} SETTINGS
@foreach($items as $setting)
@if($setting->type === 'boolean')
value ? 'checked' : '' }}>
@elseif($setting->type === 'integer' || $setting->type === 'number') @else @endif @if($setting->description) {{ $setting->description }} @endif
@endforeach
@endforeach
Database Backups
@csrf

Generates a pure-PHP SQL dump containing all table structures and rows, downloadable immediately.

@forelse($backups as $b)
{{ $b->filename }}
{{ $b->created_at->format('M d, Y H:i') }} | {{ $b->fileSizeFormatted() }}
Download
@empty
No database backups generated yet.
@endforelse
3. Permission Matrix

Configure the access control list for each user role. Super Admin permissions are permanently locked (always allowed).

@csrf @method('PUT')
@php $matrix = [ ['label' => 'Login', 'permission' => null], ['label' => 'Dashboard', 'permission' => 'dashboard.view'], ['label' => 'Create Sale', 'permission' => 'sales.create'], ['label' => 'Edit Finalized Sale', 'permission' => 'sales.edit'], ['label' => 'Void Sale', 'permission' => 'sales.void'], ['label' => 'Create Client', 'permission' => 'clients.create'], ['label' => 'Edit Client', 'permission' => 'clients.edit'], ['label' => 'Create Quotation', 'permission' => 'quotations.create'], ['label' => 'Convert Quotation', 'permission' => 'quotations.convert'], ['label' => 'Create Invoice', 'permission' => 'invoices.create'], ['label' => 'Receive Payment', 'permission' => 'payments.create'], ['label' => 'Edit Payment', 'permission' => 'payments.edit'], ['label' => 'Waive Debt', 'permission' => 'debts.waive'], ['label' => 'Refund Sale', 'permission' => 'sales.refund'], ['label' => 'Add Product', 'permission' => 'products.create'], ['label' => 'Edit Product', 'permission' => 'products.edit'], ['label' => 'Stock Adjustment', 'permission' => 'products.adjust_stock'], ['label' => 'Purchase Orders', 'permission' => 'purchase_orders.create'], ['label' => 'Add Expense', 'permission' => 'expenses.create'], ['label' => 'Approve Expense', 'permission' => 'expenses.approve'], ['label' => 'Reports Export', 'permission' => 'reports.view'], ['label' => 'Manage Staff', 'permission' => 'users.manage'], ['label' => 'Settings', 'permission' => 'settings.manage'], ['label' => 'Backups', 'permission' => 'backups.manage'], ['label' => 'Restore Backup', 'permission' => 'backups.restore'], ]; $rolesToCheck = ['cashier', 'supervisor', 'manager']; @endphp @foreach($matrix as $item) @foreach($rolesToCheck as $roleName) @endforeach @endforeach
Permission Cashier Supervisor Manager Super Admin
{{ $item['label'] }} @if($item['permission']) {{ $item['permission'] }} @endif @if(is_null($item['permission'])) @else
permissions->contains('name', $item['permission']) ? 'checked' : '' }}>
@endif
@endsection @section('scripts') @endsection