Change icons to enum
This commit is contained in:
parent
0d68062055
commit
9efde6fa34
18
app/Enums/IconName.php
Normal file
18
app/Enums/IconName.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum IconName: string
|
||||
{
|
||||
case INVOICE = 'lucide-receipt-text';
|
||||
case ORDER = 'lucide-shopping-cart';
|
||||
case QUOTE = 'lucide-quote';
|
||||
case CUSTOMER = 'lucide-building';
|
||||
case PACKING_SLIP = 'lucide-package';
|
||||
case SHIPPING_ENTRY = 'lucide-truck';
|
||||
case USER = 'lucide-users';
|
||||
case TAX_RATE = 'lucide-circle-dollar-sign';
|
||||
case PRODUCT_SERVICE = 'heroicon-o-rectangle-stack';
|
||||
case CUSTOMER_SALES = 'heroicon-o-rectangle-stack';
|
||||
case INVOICE_REPORT = 'heroicon-o-rectangle-stack';
|
||||
}
|
@ -2,11 +2,13 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Invoice;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Tables;
|
||||
use Filament\Tables\Columns\Summarizers\Summarizer;
|
||||
use Filament\Tables\Table;
|
||||
@ -18,7 +20,7 @@ class CustomerReportResource extends Resource
|
||||
|
||||
protected static ?string $navigationGroup = 'Reports';
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
protected static ?string $navigationIcon = IconName::CUSTOMER_SALES->value;
|
||||
|
||||
protected static ?string $navigationLabel = 'Customer Sales';
|
||||
|
||||
@ -93,7 +95,7 @@ public static function table(Table $table): Table
|
||||
|
||||
return '$'.number_format(round($invoiceSum, 2), 2, '.', ',');
|
||||
}))
|
||||
->weight('bold')
|
||||
->weight(FontWeight::Bold)
|
||||
->alignRight()
|
||||
->getStateUsing(function (Table $table, Model $record) {
|
||||
return $record->getTotalAttribute(
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Filament\Admin\Resources\CustomerResource\RelationManagers\ContactsRelationManager;
|
||||
use App\Filament\Admin\Resources\CustomerResource\RelationManagers\ShippingEntriesRelationManager;
|
||||
use App\Models\Customer;
|
||||
@ -17,7 +18,7 @@ class CustomerResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Customer::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-building-office';
|
||||
protected static ?string $navigationIcon = IconName::CUSTOMER->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Management';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Filament\Admin\Resources\InvoiceReportResource\RelationManagers\InvoicesRelationManager;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\Section;
|
||||
@ -16,7 +17,7 @@
|
||||
|
||||
class InvoiceReportResource extends Resource
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
protected static ?string $navigationIcon = IconName::INVOICE_REPORT->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Reports';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Enums\InvoiceStatus;
|
||||
use App\Filament\Admin\Resources\InvoiceResource\RelationManagers\OrdersRelationManager;
|
||||
use App\Filament\Admin\Resources\InvoiceResource\RelationManagers\ProductServicesRelationManager;
|
||||
@ -28,7 +29,7 @@ class InvoiceResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Invoice::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-receipt-text';
|
||||
protected static ?string $navigationIcon = IconName::INVOICE->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Production';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Enums\OrderAttributes;
|
||||
use App\Enums\OrderStatus;
|
||||
use App\Enums\OrderType;
|
||||
@ -39,7 +40,7 @@ class OrderResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Order::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-shopping-cart';
|
||||
protected static ?string $navigationIcon = IconName::ORDER->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Production';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Order;
|
||||
use App\Models\PackingSlip;
|
||||
@ -20,7 +21,7 @@ class PackingSlipResource extends Resource
|
||||
{
|
||||
protected static ?string $model = PackingSlip::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-package';
|
||||
protected static ?string $navigationIcon = IconName::PACKING_SLIP->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Management';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Models\Customer;
|
||||
use App\Models\Order;
|
||||
use App\Models\Quote;
|
||||
@ -18,7 +19,7 @@ class QuoteResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Quote::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-quote';
|
||||
protected static ?string $navigationIcon = IconName::QUOTE->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Production';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Filament\Admin\Resources\ServiceTypeResource\Widgets\ServiceTypeOverview;
|
||||
use App\Models\ServiceType;
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
@ -15,7 +16,7 @@ class ServiceTypeResource extends Resource
|
||||
{
|
||||
protected static ?string $model = ServiceType::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||
protected static ?string $navigationIcon = IconName::PRODUCT_SERVICE->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Reports';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Enums\ShippingType;
|
||||
use App\Models\ShippingEntry;
|
||||
use Filament\Forms\Components\Fieldset;
|
||||
@ -24,7 +25,7 @@ class ShippingEntryResource extends Resource
|
||||
{
|
||||
protected static ?string $model = ShippingEntry::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-truck';
|
||||
protected static ?string $navigationIcon = IconName::SHIPPING_ENTRY->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Management';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Filament\Admin\Resources\TaxRateResource\Pages;
|
||||
use App\Models\TaxRate;
|
||||
use Filament\Forms\Components\Placeholder;
|
||||
@ -18,7 +19,7 @@ class TaxRateResource extends Resource
|
||||
{
|
||||
protected static ?string $model = TaxRate::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-circle-dollar-sign';
|
||||
protected static ?string $navigationIcon = IconName::TAX_RATE->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Settings';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Admin\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Models\User;
|
||||
use Filament\Forms\Components\Checkbox;
|
||||
use Filament\Forms\Components\Section;
|
||||
@ -18,7 +19,7 @@ class UserResource extends Resource
|
||||
|
||||
protected static ?string $model = User::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-users';
|
||||
protected static ?string $navigationIcon = IconName::USER->value;
|
||||
|
||||
protected static ?string $navigationGroup = 'Settings';
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Customer\Resources;
|
||||
|
||||
use App\Enums\IconName;
|
||||
use App\Filament\Customer\Resources\OrderResource\Pages;
|
||||
use App\Models\Order;
|
||||
use Filament\Forms\Form;
|
||||
@ -14,7 +15,7 @@ class OrderResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Order::class;
|
||||
|
||||
protected static ?string $navigationIcon = 'lucide-shopping-cart';
|
||||
protected static ?string $navigationIcon = IconName::ORDER->value;
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user