Integrate multi-currency debt visibility across the platform by adding support for foreign currency credits in the user profile shortcode, improving the admin dashboard with unsettled credits widgets, and enhancing the Filament admin panel with navigation badges and relation managers. - Add multi-currency debt table to WordPress user profile shortcode - Implement `UnsettledCreditsWidget` for Filament dashboard - Add navigation badge to `CustomerCreditResource` for open credits - Add `CreditsRelationManager` to `UserResource` - Update `CustomerOrderController` API to include `foreign_credits` - Add concurrency check in `CustomerCreditService` during settlement
106 lines
4.6 KiB
PHP
106 lines
4.6 KiB
PHP
<?php
|
|
|
|
namespace App\Providers\Filament;
|
|
|
|
use Filament\Http\Middleware\Authenticate;
|
|
use Filament\Http\Middleware\DisableBladeIconComponents;
|
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
|
use Filament\Pages;
|
|
use Filament\Panel;
|
|
use Filament\PanelProvider;
|
|
use Filament\Support\Colors\Color;
|
|
use Filament\Widgets;
|
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
|
use Illuminate\Cookie\Middleware\EncryptCookies;
|
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
|
use Illuminate\Session\Middleware\AuthenticateSession;
|
|
use Illuminate\Session\Middleware\StartSession;
|
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
|
|
|
class AdminPanelProvider extends PanelProvider
|
|
{
|
|
public function panel(Panel $panel): Panel
|
|
{
|
|
return $panel
|
|
->default()
|
|
->id('admin')
|
|
->path('panel')
|
|
->login(\App\Filament\Pages\Auth\Login::class)
|
|
->brandName('IFNEX Logistics')
|
|
// لوگوی برند در نوار بالا — همان لوگوی صفحه لاگین
|
|
->brandLogo(asset('images/ifnex-logo.png'))
|
|
->brandLogoHeight('2.5rem')
|
|
->colors([
|
|
'primary' => Color::Amber,
|
|
'gray' => [
|
|
50 => '#f8fafc',
|
|
100 => '#f1f5f9',
|
|
200 => '#e2e8f0',
|
|
300 => '#cbd5e1',
|
|
400 => '#94a3b8',
|
|
500 => '#64748b',
|
|
600 => '#475569',
|
|
700 => '#334155',
|
|
800 => '#1e293b',
|
|
900 => '#1a1a2e',
|
|
950 => '#0f172a',
|
|
],
|
|
'danger' => Color::Red,
|
|
'info' => Color::Blue,
|
|
'success' => Color::Emerald,
|
|
'warning' => Color::Amber,
|
|
])
|
|
->font('Vazirmatn')
|
|
->spa()
|
|
->sidebarCollapsibleOnDesktop()
|
|
->darkMode(true)
|
|
->databaseNotifications()
|
|
->globalSearchKeyBindings(['command+k', 'ctrl+k'])
|
|
->discoverResources(in: app_path('Filament/Resources'), for: 'App\\Filament\\Resources')
|
|
->discoverPages(in: app_path('Filament/Pages'), for: 'App\\Filament\\Pages')
|
|
// ─── ترتیب و گروهبندی منوی ناوبری ───
|
|
->navigationGroups([
|
|
'عملیات',
|
|
'مالی',
|
|
'تنظیمات',
|
|
'گزارشها',
|
|
'ابزارها',
|
|
])
|
|
// ─── بارگذاری استایل سفارشی IFNEX بهعنوان تم فیلمنت ───
|
|
// ->viteTheme('resources/css/filament.css') // موقتاً غیرفعال تا npm run build
|
|
// ⚠️ Pages\Dashboard::class اینجا ثبت نشود — App\Filament\Pages\Dashboard
|
|
// از طریق discoverPages کشف میشود؛ ثبت صریح داشبورد پایه باعث میشود
|
|
// نسخه پایه (با کل استخر ویجتهای کشفشده) بر override سهلایه غلبه کند
|
|
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
|
->widgets([
|
|
\App\Filament\Widgets\RecentShipmentsWidget::class,
|
|
\App\Filament\Widgets\ExchangeRateWidget::class,
|
|
\App\Filament\Widgets\UnsettledCreditsWidget::class,
|
|
])
|
|
->middleware([
|
|
EncryptCookies::class,
|
|
AddQueuedCookiesToResponse::class,
|
|
StartSession::class,
|
|
AuthenticateSession::class,
|
|
ShareErrorsFromSession::class,
|
|
VerifyCsrfToken::class,
|
|
SubstituteBindings::class,
|
|
DisableBladeIconComponents::class,
|
|
DispatchServingFilamentEvent::class,
|
|
])
|
|
->authMiddleware([
|
|
Authenticate::class,
|
|
])
|
|
->renderHook(
|
|
'panels::head.start',
|
|
fn () => view('filament.hooks.head')
|
|
)
|
|
->renderHook(
|
|
\Filament\View\PanelsRenderHook::FOOTER,
|
|
fn () => '<div style="text-align:center;padding:10px 0;font-size:12px;color:#94a3b8;">'
|
|
. 'قدرت گرفته از <a href="https://vernasoft.ir" target="_blank" rel="noopener" '
|
|
. 'style="color:#f59e0b;font-weight:600;text-decoration:none;">ورنا سافت</a></div>'
|
|
);
|
|
}
|
|
} |