@extends('layouts.auth2') @section('title', config('app.name', 'POS')) @section('body_class', 'landing-login-page') @inject('request', 'Illuminate\Http\Request') @section('content') @php $username = old('username'); $password = null; $app_login_logo = \App\System::getProperty('app_login_logo'); $login_business = \App\Business::whereNotNull('logo')->where('logo', '!=', '')->latest('updated_at')->first(); $login_business_for_name = $login_business ?: \App\Business::latest('updated_at')->first(); $login_logo_file = !empty($app_login_logo) ? $app_login_logo : ($login_business->logo ?? null); $login_logo_path = !empty($login_logo_file) ? public_path('uploads/business_logos/' . $login_logo_file) : null; $current_host = request()->getSchemeAndHttpHost(); if (!empty($login_logo_path) && file_exists($login_logo_path)) { $login_logo = $current_host . '/uploads/business_logos/' . rawurlencode($login_logo_file) . '?v=' . filemtime($login_logo_path); } elseif (file_exists(public_path('uploads/cms/logo.png'))) { $login_logo = $current_host . '/uploads/cms/logo.png?v=' . filemtime(public_path('uploads/cms/logo.png')); } elseif (file_exists(public_path('uploads/logo.png'))) { $login_logo = $current_host . '/uploads/logo.png?v=' . filemtime(public_path('uploads/logo.png')); } else { $login_logo = asset('img/logo-small.png'); } $login_brand_name = !empty($login_business_for_name->name) ? $login_business_for_name->name : config('app.name', 'POS'); if (config('app.env') == 'demo') { $username = 'admin'; $password = '123456'; $demo_types = [ 'all_in_one' => 'admin', 'restaurant' => 'admin-restaurant', 'pharmacy' => 'admin-pharmacy', ]; if (!empty($_GET['demo_type']) && array_key_exists($_GET['demo_type'], $demo_types)) { $username = $demo_types[$_GET['demo_type']]; } } @endphp