done converting /src/constants files to laravel php codes
This commit is contained in:
parent
0077ae9ddb
commit
d64ea6ccb8
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class ActionTypes extends Component
|
||||||
|
{
|
||||||
|
public $actionTypes = [
|
||||||
|
'LOGOUT' => 'Logout Initiated',
|
||||||
|
'LOGOUT_SUCCESS' => 'Logout Successful',
|
||||||
|
'LOGOUT_RESET' => 'Logout Reset',
|
||||||
|
'FETCH_DATA' => 'Fetch Data Initiated',
|
||||||
|
'FETCH_DATA_SUCCESS' => 'Fetch Data Successful',
|
||||||
|
'FETCH_DATA_ERROR' => 'Fetch Data Failed',
|
||||||
|
'FETCH_DATA_RESET' => 'Fetch Data Reset',
|
||||||
|
];
|
||||||
|
|
||||||
|
public $actionType = 'FETCH_DATA_SUCCESS'; // Default action type for demo
|
||||||
|
|
||||||
|
public function mount($actionType = 'FETCH_DATA_SUCCESS')
|
||||||
|
{
|
||||||
|
$this->actionType = $actionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.action-types');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class DashboardLayout extends Component
|
||||||
|
{
|
||||||
|
public $collapsed = false;
|
||||||
|
public $userInfo;
|
||||||
|
public $systemPreferences;
|
||||||
|
|
||||||
|
public function mount($userInfo = null, $systemPreferences = null)
|
||||||
|
{
|
||||||
|
$this->userInfo = $userInfo ?? ['userInfo' => ['firstname' => 'John', 'lastname' => 'Doe']];
|
||||||
|
$this->systemPreferences = $systemPreferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggle()
|
||||||
|
{
|
||||||
|
$this->collapsed = !$this->collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.dashboard-layout');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class DashboardRoute extends Component
|
||||||
|
{
|
||||||
|
public $isAuthenticated = true;
|
||||||
|
|
||||||
|
public function mount($isAuthenticated = true)
|
||||||
|
{
|
||||||
|
$this->isAuthenticated = $isAuthenticated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.dashboard-route');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class GlobalConstants extends Component
|
||||||
|
{
|
||||||
|
public $loadingTime = 3000; // From global.js
|
||||||
|
|
||||||
|
public function mount($loadingTime = 3000)
|
||||||
|
{
|
||||||
|
$this->loadingTime = $loadingTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.global-constants');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class HeaderDropdown extends Component
|
||||||
|
{
|
||||||
|
public $userInfo;
|
||||||
|
|
||||||
|
public function mount($userInfo)
|
||||||
|
{
|
||||||
|
$this->userInfo = $userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.header-dropdown');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class MainBreadcrumbs extends Component
|
||||||
|
{
|
||||||
|
public $pageRoutes = [];
|
||||||
|
public $root = false;
|
||||||
|
|
||||||
|
public function mount($pageRoutes = [], $root = false)
|
||||||
|
{
|
||||||
|
$this->pageRoutes = $pageRoutes;
|
||||||
|
$this->root = $root;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$pathSnippets = array_filter(explode('/', request()->path()));
|
||||||
|
$breadcrumbs = $this->root ? [['name' => 'Home', 'url' => '/dashboard']] : $this->buildBreadcrumbs($pathSnippets);
|
||||||
|
|
||||||
|
return view('livewire.main-breadcrumbs', ['breadcrumbs' => $breadcrumbs]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function buildBreadcrumbs($pathSnippets)
|
||||||
|
{
|
||||||
|
$breadcrumbs = [['name' => 'Home', 'url' => '/dashboard']];
|
||||||
|
foreach ($pathSnippets as $index => $snippet) {
|
||||||
|
$url = '/' . implode('/', array_slice($pathSnippets, 0, $index + 1));
|
||||||
|
$routeMatch = array_filter($this->pageRoutes, fn($route) => $route['path'] === $url);
|
||||||
|
if ($routeMatch) {
|
||||||
|
$route = array_shift($routeMatch);
|
||||||
|
$breadcrumbs[] = ['name' => $route['name'], 'url' => $url];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $breadcrumbs;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class MainFooter extends Component
|
||||||
|
{
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.main-footer');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class MainHeader extends Component
|
||||||
|
{
|
||||||
|
public $collapsed = false;
|
||||||
|
|
||||||
|
public function mount($collapsed = false)
|
||||||
|
{
|
||||||
|
$this->collapsed = $collapsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function toggle()
|
||||||
|
{
|
||||||
|
$this->collapsed = !$this->collapsed;
|
||||||
|
$this->dispatch('toggleSidebar', $this->collapsed);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.main-header');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class MainSidebar extends Component
|
||||||
|
{
|
||||||
|
public $collapsed = false;
|
||||||
|
public $userInfo;
|
||||||
|
public $systemPreferences;
|
||||||
|
|
||||||
|
public $navigation = [
|
||||||
|
[
|
||||||
|
'key' => 0,
|
||||||
|
'label' => 'User Management',
|
||||||
|
'path' => '/user-management',
|
||||||
|
'icon' => 'bi-people',
|
||||||
|
'access' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 9,
|
||||||
|
'label' => 'Notifications',
|
||||||
|
'path' => '/notifications',
|
||||||
|
'icon' => 'bi-bell',
|
||||||
|
'access' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 4,
|
||||||
|
'label' => 'Member Management',
|
||||||
|
'path' => '/member-management',
|
||||||
|
'icon' => 'bi-credit-card',
|
||||||
|
'access' => true,
|
||||||
|
'child' => [
|
||||||
|
['key' => 0.0, 'label' => 'Card Member', 'path' => '/member-management/card-member', 'access' => true],
|
||||||
|
['key' => 0.1, 'label' => 'Locked Accounts', 'path' => '/member-management/lock-account', 'access' => true],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 8,
|
||||||
|
'label' => 'Home Page (Mobile)',
|
||||||
|
'path' => '/home-page',
|
||||||
|
'icon' => 'bi-house',
|
||||||
|
'access' => true,
|
||||||
|
'child' => [
|
||||||
|
['key' => 0.0, 'label' => 'Photo Slider', 'path' => '/home-page/photo-slider', 'access' => true],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 3,
|
||||||
|
'label' => 'Promotions',
|
||||||
|
'path' => '/promotions',
|
||||||
|
'icon' => 'bi-tags',
|
||||||
|
'access' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 2,
|
||||||
|
'label' => 'Top-Up',
|
||||||
|
'path' => '/top-up',
|
||||||
|
'icon' => 'bi-plus-circle',
|
||||||
|
'access' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 6,
|
||||||
|
'label' => 'About Us',
|
||||||
|
'path' => '/about-us',
|
||||||
|
'icon' => 'bi-info-circle',
|
||||||
|
'access' => true,
|
||||||
|
'child' => [
|
||||||
|
['key' => 0.6, 'label' => 'Card Types', 'path' => '/about-us/card-types', 'access' => true],
|
||||||
|
['key' => 0.5, 'label' => 'Terms & Privacy', 'path' => '/about-us/term-privacy', 'access' => true],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 7,
|
||||||
|
'label' => 'Reports',
|
||||||
|
'path' => '/reports',
|
||||||
|
'icon' => 'bi-file-text',
|
||||||
|
'access' => true,
|
||||||
|
'child' => [
|
||||||
|
['key' => 0.7, 'label' => 'Registration Report', 'path' => '/reports/registration-report', 'access' => true],
|
||||||
|
['key' => 0.8, 'label' => 'Top-Up Usage Report', 'path' => '/reports/top-up', 'access' => true],
|
||||||
|
['key' => 0.9, 'label' => 'Mobile Usage Report', 'path' => '/reports/mobile-report', 'access' => true],
|
||||||
|
['key' => 0.1, 'label' => 'Station Rating Report', 'path' => '/reports/station-rating', 'access' => true],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 8,
|
||||||
|
'label' => 'System Parameters',
|
||||||
|
'path' => '/system-parameters',
|
||||||
|
'icon' => 'bi-gear',
|
||||||
|
'access' => true,
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'key' => 12,
|
||||||
|
'label' => 'Station Locator',
|
||||||
|
'path' => '',
|
||||||
|
'icon' => 'bi-geo-alt',
|
||||||
|
'access' => true,
|
||||||
|
'child' => [
|
||||||
|
['key' => 0.11, 'label' => 'Branches', 'path' => '/branches', 'access' => true],
|
||||||
|
['key' => 0.12, 'label' => 'Stations', 'path' => '/stations', 'access' => true],
|
||||||
|
['key' => 0.13, 'label' => 'Fuels', 'path' => '/fuels', 'access' => true],
|
||||||
|
],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
public function mount($collapsed = false, $userInfo = [], $systemPreferences = null)
|
||||||
|
{
|
||||||
|
$this->collapsed = $collapsed;
|
||||||
|
$this->userInfo = $userInfo;
|
||||||
|
$this->systemPreferences = $systemPreferences;
|
||||||
|
|
||||||
|
// Filter navigation based on access (static for frontend)
|
||||||
|
$this->navigation = array_filter($this->navigation, fn($item) => $this->hasAccess($item));
|
||||||
|
}
|
||||||
|
|
||||||
|
private function hasAccess($item)
|
||||||
|
{
|
||||||
|
// Static access logic based on role (frontend-only simulation)
|
||||||
|
$role = $this->userInfo['role'] ?? 0;
|
||||||
|
return $item['access'] && ($role === 1 || !$item['access']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.main-sidebar');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class ResponseStatus extends Component
|
||||||
|
{
|
||||||
|
// HTTP Status Codes from Response.js
|
||||||
|
public $responseCodes = [
|
||||||
|
'HTTP_CONTINUE' => 100,
|
||||||
|
'HTTP_SWITCHING_PROTOCOLS' => 101,
|
||||||
|
'HTTP_PROCESSING' => 102,
|
||||||
|
'HTTP_EARLY_HINTS' => 103,
|
||||||
|
'HTTP_OK' => 200,
|
||||||
|
'HTTP_CREATED' => 201,
|
||||||
|
'HTTP_ACCEPTED' => 202,
|
||||||
|
'HTTP_NON_AUTHORITATIVE_INFORMATION' => 203,
|
||||||
|
'HTTP_NO_CONTENT' => 204,
|
||||||
|
'HTTP_RESET_CONTENT' => 205,
|
||||||
|
'HTTP_PARTIAL_CONTENT' => 206,
|
||||||
|
'HTTP_MULTI_STATUS' => 207,
|
||||||
|
'HTTP_ALREADY_REPORTED' => 208,
|
||||||
|
'HTTP_IM_USED' => 226,
|
||||||
|
'HTTP_MULTIPLE_CHOICES' => 300,
|
||||||
|
'HTTP_MOVED_PERMANENTLY' => 301,
|
||||||
|
'HTTP_FOUND' => 302,
|
||||||
|
'HTTP_SEE_OTHER' => 303,
|
||||||
|
'HTTP_NOT_MODIFIED' => 304,
|
||||||
|
'HTTP_USE_PROXY' => 305,
|
||||||
|
'HTTP_TEMPORARY_REDIRECT' => 307,
|
||||||
|
'HTTP_PERMANENTLY_REDIRECT' => 308,
|
||||||
|
'HTTP_BAD_REQUEST' => 400,
|
||||||
|
'HTTP_UNAUTHORIZED' => 401,
|
||||||
|
'HTTP_PAYMENT_REQUIRED' => 402,
|
||||||
|
'HTTP_FORBIDDEN' => 403,
|
||||||
|
'HTTP_NOT_FOUND' => 404,
|
||||||
|
'HTTP_METHOD_NOT_ALLOWED' => 405,
|
||||||
|
'HTTP_NOT_ACCEPTABLE' => 406,
|
||||||
|
'HTTP_PROXY_AUTHENTICATION_REQUIRED' => 407,
|
||||||
|
'HTTP_REQUEST_TIMEOUT' => 408,
|
||||||
|
'HTTP_CONFLICT' => 409,
|
||||||
|
'HTTP_GONE' => 410,
|
||||||
|
'HTTP_LENGTH_REQUIRED' => 411,
|
||||||
|
'HTTP_PRECONDITION_FAILED' => 412,
|
||||||
|
'HTTP_REQUEST_ENTITY_TOO_LARGE' => 413,
|
||||||
|
'HTTP_REQUEST_URI_TOO_LONG' => 414,
|
||||||
|
'HTTP_UNSUPPORTED_MEDIA_TYPE' => 415,
|
||||||
|
'HTTP_REQUESTED_RANGE_NOT_SATISFIABLE' => 416,
|
||||||
|
'HTTP_EXPECTATION_FAILED' => 417,
|
||||||
|
'HTTP_I_AM_A_TEAPOT' => 418,
|
||||||
|
'HTTP_MISDIRECTED_REQUEST' => 421,
|
||||||
|
'HTTP_UNPROCESSABLE_ENTITY' => 422,
|
||||||
|
'HTTP_LOCKED' => 423,
|
||||||
|
'HTTP_FAILED_DEPENDENCY' => 424,
|
||||||
|
'HTTP_UPGRADE_REQUIRED' => 426,
|
||||||
|
'HTTP_PRECONDITION_REQUIRED' => 428,
|
||||||
|
'HTTP_TOO_MANY_REQUESTS' => 429,
|
||||||
|
'HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE' => 431,
|
||||||
|
'HTTP_UNAVAILABLE_FOR_LEGAL_REASONS' => 451,
|
||||||
|
'HTTP_INTERNAL_SERVER_ERROR' => 500,
|
||||||
|
'HTTP_NOT_IMPLEMENTED' => 501,
|
||||||
|
'HTTP_BAD_GATEWAY' => 502,
|
||||||
|
'HTTP_SERVICE_UNAVAILABLE' => 503,
|
||||||
|
'HTTP_GATEWAY_TIMEOUT' => 504,
|
||||||
|
'HTTP_VERSION_NOT_SUPPORTED' => 505,
|
||||||
|
'HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL' => 506,
|
||||||
|
'HTTP_INSUFFICIENT_STORAGE' => 507,
|
||||||
|
'HTTP_LOOP_DETECTED' => 508,
|
||||||
|
'HTTP_NOT_EXTENDED' => 510,
|
||||||
|
'HTTP_NETWORK_AUTHENTICATION_REQUIRED' => 511,
|
||||||
|
];
|
||||||
|
|
||||||
|
// Action Types from Types.js (simulated as static labels)
|
||||||
|
public $actionTypes = [
|
||||||
|
'LOGOUT' => 'Logout Initiated',
|
||||||
|
'LOGOUT_SUCCESS' => 'Logout Successful',
|
||||||
|
'LOGOUT_RESET' => 'Logout Reset',
|
||||||
|
'FETCH_DATA' => 'Fetch Data Initiated',
|
||||||
|
'FETCH_DATA_SUCCESS' => 'Fetch Data Successful',
|
||||||
|
'FETCH_DATA_ERROR' => 'Fetch Data Failed',
|
||||||
|
'FETCH_DATA_RESET' => 'Fetch Data Reset',
|
||||||
|
];
|
||||||
|
|
||||||
|
public $statusCode = 200; // Default status for demo
|
||||||
|
public $actionType = 'FETCH_DATA_SUCCESS'; // Default action type for demo
|
||||||
|
|
||||||
|
public function mount($statusCode = 200, $actionType = 'FETCH_DATA_SUCCESS')
|
||||||
|
{
|
||||||
|
$this->statusCode = $statusCode;
|
||||||
|
$this->actionType = $actionType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.response-display');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class ValidationDisplay extends Component
|
||||||
|
{
|
||||||
|
public $validationRules = [
|
||||||
|
'required' => 'This is a required field.',
|
||||||
|
'dropdownRequired' => 'This is a required field.',
|
||||||
|
'requiredAtleastOne' => 'At least one must be selected.',
|
||||||
|
'arrayChecker' => 'This is a required field.',
|
||||||
|
'email' => 'Please provide a valid email address.',
|
||||||
|
'alphaNumeric' => 'Only alphanumeric characters',
|
||||||
|
'length4' => 'Must be 4 characters.',
|
||||||
|
'minLength2' => 'Must be 2 characters or more',
|
||||||
|
'maxLength10' => 'Must be 10 characters or less.',
|
||||||
|
'numbers' => 'Must be whole numbers only.',
|
||||||
|
'numbersWithDecimals' => 'Must be a valid number with two (2) decimals only.',
|
||||||
|
'minValue0' => 'Must be greater than 0.',
|
||||||
|
'maxValue100' => 'Must be less than 100.',
|
||||||
|
];
|
||||||
|
|
||||||
|
public $rule = 'required'; // Default rule for demo
|
||||||
|
|
||||||
|
public function mount($rule = 'required')
|
||||||
|
{
|
||||||
|
$this->rule = $rule;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.validation-display');
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'Action Types')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('action-types', ['actionType' => 'FETCH_DATA_SUCCESS'])
|
||||||
|
@endsection
|
|
@ -0,0 +1,15 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'Dashboard')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('main-breadcrumbs', ['pageRoutes' => [
|
||||||
|
['path' => '/dashboard', 'name' => 'Dashboard'],
|
||||||
|
['path' => '/my-profile', 'name' => 'Profile'],
|
||||||
|
], 'root' => true])
|
||||||
|
<div class="p-0" style="background: #fff;">
|
||||||
|
<h1>Welcome to the Dashboard</h1>
|
||||||
|
<p>This is the main content area for the dashboard.</p>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'Global Constants')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('global-constants', ['loadingTime' => 3000])
|
||||||
|
@endsection
|
|
@ -1,16 +1,24 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Laravel</title>
|
<title>@yield('title')</title>
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.0/font/bootstrap-icons.css" rel="stylesheet">
|
||||||
@livewireStyles
|
@livewireStyles
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<header class="mb-4">
|
||||||
|
@livewire('header-dropdown', ['userInfo' => ['firstname' => 'John', 'lastname' => 'Doe']])
|
||||||
|
</header>
|
||||||
|
<div class="container">
|
||||||
@yield('content')
|
@yield('content')
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
</div>
|
||||||
|
<footer class="mt-5">
|
||||||
|
@livewire('main-footer')
|
||||||
|
</footer>
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
@livewireScripts
|
@livewireScripts
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="container my-5">
|
||||||
|
<h1 class="mb-4">Action Type</h1>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Action: {{ $actionTypes[$actionType] ?? 'Unknown Action' }}</h5>
|
||||||
|
<p class="card-text">Type Key: {{ $actionType }}</p>
|
||||||
|
<div class="alert alert-info mt-3">
|
||||||
|
This represents a frontend action status.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,20 @@
|
||||||
|
<div class="d-flex" style="height: 100vh;">
|
||||||
|
<!-- Sidebar -->
|
||||||
|
@livewire('main-sidebar', [
|
||||||
|
'collapsed' => $collapsed,
|
||||||
|
'userInfo' => $userInfo,
|
||||||
|
'systemPreferences' => $systemPreferences
|
||||||
|
])
|
||||||
|
|
||||||
|
<!-- Main Content Area -->
|
||||||
|
<div class="flex-grow-1 d-flex flex-column" style="background: #fcfcfc; padding-bottom: 10px;">
|
||||||
|
@livewire('main-header', [
|
||||||
|
'collapsed' => $collapsed,
|
||||||
|
'toggle' => fn() => $this->toggle()
|
||||||
|
])
|
||||||
|
<div class="flex-grow-1 overflow-auto" style="margin-top: 94px; padding-top: 16px; position: relative;">
|
||||||
|
{{ $slot }} <!-- Placeholder for child content -->
|
||||||
|
</div>
|
||||||
|
@livewire('main-footer')
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,15 @@
|
||||||
|
<div>
|
||||||
|
@if($isAuthenticated)
|
||||||
|
@livewire('dashboard-layout', [
|
||||||
|
'userInfo' => ['userInfo' => ['firstname' => 'John', 'lastname' => 'Doe']],
|
||||||
|
'systemPreferences' => null
|
||||||
|
])
|
||||||
|
{{ $slot }}
|
||||||
|
@endlivewire
|
||||||
|
@else
|
||||||
|
<div class="alert alert-warning text-center">
|
||||||
|
<p>You must log in to enter this page.</p>
|
||||||
|
<a href="/login" class="btn btn-primary">Go to Login</a>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="container my-5">
|
||||||
|
<h1 class="mb-4">Global Constants</h1>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Loading Time</h5>
|
||||||
|
<p class="card-text">Default Loading Time: {{ $loadingTime / 1000 }} seconds</p>
|
||||||
|
<div class="alert alert-info mt-3">
|
||||||
|
This value represents the default loading time used in the application.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-link dropdown-toggle text-muted" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false" style="margin-right: 16px; max-width: 256px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;">
|
||||||
|
<img src="{{ $userInfo['avatar'] ?? 'https://via.placeholder.com/30' }}" alt="Avatar" class="rounded-circle me-2" style="width: 30px; height: 30px; background: #B8BBC9;">
|
||||||
|
{{ $userInfo['firstname'] }} {{ $userInfo['lastname'] }}
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end" style="width: 150px;" aria-labelledby="dropdownMenuButton">
|
||||||
|
<li><a class="dropdown-item" href="/my-profile"><i class="bi bi-person me-2"></i>My Profile</a></li>
|
||||||
|
<li><hr class="dropdown-divider"></li>
|
||||||
|
<li><a class="dropdown-item" href="/logout"><i class="bi bi-box-arrow-right me-2"></i>Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<nav aria-label="breadcrumb" style="padding: 11px 24px 9px; font-size: 12px;">
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
@foreach($breadcrumbs as $breadcrumb)
|
||||||
|
@if($loop->last)
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">{{ $breadcrumb['name'] }}</li>
|
||||||
|
@else
|
||||||
|
<li class="breadcrumb-item"><a href="{{ $breadcrumb['url'] }}">{{ $breadcrumb['name'] }}</a></li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ol>
|
||||||
|
</nav>
|
|
@ -0,0 +1,3 @@
|
||||||
|
<footer class="text-center py-3 bg-light">
|
||||||
|
<p>© {{ date('Y') }} Dashboard App. All rights reserved.</p>
|
||||||
|
</footer>
|
|
@ -0,0 +1,14 @@
|
||||||
|
<div class="d-flex align-items-center justify-content-between px-4 py-2 border-bottom bg-white" style="height: 66px;">
|
||||||
|
<button wire:click="toggleSidebar" class="btn btn-outline-secondary">
|
||||||
|
<i class="bi" :class="$collapsed ? 'bi-list' : 'bi-x'"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<div class="dropdown">
|
||||||
|
<a class="dropdown-toggle text-decoration-none" href="#" data-bs-toggle="dropdown">
|
||||||
|
<img src="https://via.placeholder.com/30" class="rounded-circle" />
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
|
<li><a class="dropdown-item" href="#">Logout</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,34 @@
|
||||||
|
<div class="bg-white border-end {{ $collapsed ? 'w-25' : 'w-75' }}" style="min-height: 100vh; transition: width 0.3s;">
|
||||||
|
@if(!$collapsed)
|
||||||
|
<div class="text-center py-3 border-bottom" style="height: 65px;">
|
||||||
|
<img src="{{ $systemPreferences ?? ($userInfo['logo'] ?? 'https://via.placeholder.com/40') }}" alt="Logo" style="height: 100%;">
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div class="py-4 text-center" style="height: 64px; background: url('{{ $systemPreferences ?? ($userInfo['logo'] ?? 'https://via.placeholder.com/40') }}') no-repeat center / contain;"></div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<div class="nav flex-column {{ !$collapsed ? 'pt-4' : '' }}" style="height: 90vh; overflow-y: auto;">
|
||||||
|
@foreach($navigation as $item)
|
||||||
|
@if(isset($item['child']))
|
||||||
|
<div class="nav-item dropdown">
|
||||||
|
<a class="nav-link text-dark {{ $collapsed ? 'px-3' : 'px-4' }}" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
<i class="{{ $item['icon'] }} me-2"></i>
|
||||||
|
@if(!$collapsed) {{ $item['label'] }} @endif
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
@foreach($item['child'] as $subItem)
|
||||||
|
@if($subItem['access'])
|
||||||
|
<li><a class="dropdown-item" href="{{ $subItem['path'] }}">{{ $subItem['label'] }}</a></li>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<a class="nav-link text-dark {{ $collapsed ? 'px-3' : 'px-4' }}" href="{{ $item['path'] }}">
|
||||||
|
<i class="{{ $item['icon'] }} me-2"></i>
|
||||||
|
@if(!$collapsed) {{ $item['label'] }} @endif
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="container my-5">
|
||||||
|
<h1 class="mb-4">Response Status</h1>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Status: {{ array_search($statusCode, $responseCodes) }} ({{ $statusCode }})</h5>
|
||||||
|
<p class="card-text">
|
||||||
|
Action: {{ $actionTypes[$actionType] ?? 'Unknown Action' }}
|
||||||
|
</p>
|
||||||
|
<div class="alert {{ $statusCode < 400 ? 'alert-success' : 'alert-danger' }} mt-3">
|
||||||
|
@if($statusCode < 400)
|
||||||
|
Success! The operation completed successfully.
|
||||||
|
@else
|
||||||
|
Error! Something went wrong with the request.
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,12 @@
|
||||||
|
<div class="container my-5">
|
||||||
|
<h1 class="mb-4">Validation Rules</h1>
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h5 class="card-title">Rule: {{ $rule }}</h5>
|
||||||
|
<p class="card-text">Message: {{ $validationRules[$rule] ?? 'Unknown Rule' }}</p>
|
||||||
|
<div class="alert alert-warning mt-3">
|
||||||
|
This is an example validation message for the selected rule.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -4,5 +4,7 @@
|
||||||
<div class="container py-5">
|
<div class="container py-5">
|
||||||
<h1 class="text-center mb-4">Login</h1>
|
<h1 class="text-center mb-4">Login</h1>
|
||||||
<p class="text-center">Placeholder for login form.</p>
|
<p class="text-center">Placeholder for login form.</p>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@endsection
|
@endsection
|
|
@ -0,0 +1,14 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'My Profile')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('main-breadcrumbs', ['pageRoutes' => [
|
||||||
|
['path' => '/dashboard', 'name' => 'Dashboard'],
|
||||||
|
['path' => '/my-profile', 'name' => 'Profile'],
|
||||||
|
]])
|
||||||
|
<div class="p-0" style="background: #fff;">
|
||||||
|
<h1>My Profile</h1>
|
||||||
|
<p>View your profile details here.</p>
|
||||||
|
</div>
|
||||||
|
@endsection
|
|
@ -0,0 +1,7 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'Response Display')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('response-display', ['statusCode' => 200])
|
||||||
|
@endsection
|
|
@ -0,0 +1,7 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'Response Status')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('response-status', ['statusCode' => 200, 'actionType' => 'FETCH_DATA_SUCCESS'])
|
||||||
|
@endsection
|
|
@ -0,0 +1,7 @@
|
||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('title', 'Validation Display')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
@livewire('validation-display', ['rule' => 'required'])
|
||||||
|
@endsection
|
File diff suppressed because one or more lines are too long
|
@ -36,6 +36,26 @@ use App\Livewire\DropdownExport;
|
||||||
use App\Livewire\DataList;
|
use App\Livewire\DataList;
|
||||||
use App\Livewire\CustomTable;
|
use App\Livewire\CustomTable;
|
||||||
|
|
||||||
|
use App\Livewire\ResponseDisplay;
|
||||||
|
use App\Livewire\ActionTypes;
|
||||||
|
use App\Livewire\GlobalConstants;
|
||||||
|
use App\Livewire\ValidationDisplay;
|
||||||
|
|
||||||
|
|
||||||
|
Route::get('/global-constants', function () { return view('global-constants'); })->name('global.constants');
|
||||||
|
|
||||||
|
Route::get('/validation-display', function () { return view('validation-display'); })->name('validation.display');
|
||||||
|
|
||||||
|
Route::get('/response-display', function () { return view('response-display'); })->name('response.display');
|
||||||
|
|
||||||
|
Route::get('/action-types', function () { return view('action-types'); })->name('action.types');
|
||||||
|
Route::get('/dashboard', function () { return view('dashboard'); })->name('dashboard');
|
||||||
|
|
||||||
|
Route::get('/my-profile', function () {
|
||||||
|
return view('my-profile');
|
||||||
|
})->name('my-profile');
|
||||||
|
|
||||||
|
|
||||||
Route::get('/custom-table', function () {
|
Route::get('/custom-table', function () {
|
||||||
return view('custom-table');
|
return view('custom-table');
|
||||||
})->name('custom.table');
|
})->name('custom.table');
|
||||||
|
|
Loading…
Reference in New Issue