wip
This commit is contained in:
@@ -70,7 +70,10 @@ class CardOrdersTable
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
TextColumn::make('status')
|
TextColumn::make('status')
|
||||||
|
->label(__('Status'))
|
||||||
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state))
|
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state))
|
||||||
|
->badge()
|
||||||
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
TextColumn::make('updated_at')
|
TextColumn::make('updated_at')
|
||||||
|
|||||||
@@ -55,7 +55,10 @@ class CardPinOrdersTable
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
TextColumn::make('status')
|
TextColumn::make('status')
|
||||||
|
->label(__('Status'))
|
||||||
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state))
|
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state))
|
||||||
|
->sortable()
|
||||||
|
->badge()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
])
|
])
|
||||||
->filters([
|
->filters([
|
||||||
|
|||||||
@@ -53,11 +53,6 @@ class LoanOrderResource extends Resource
|
|||||||
return LoanOrderForm::configure($schema);
|
return LoanOrderForm::configure($schema);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function infolist(Schema $schema): Schema
|
|
||||||
{
|
|
||||||
return LoanOrderInfolist::configure($schema);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function table(Table $table): Table
|
public static function table(Table $table): Table
|
||||||
{
|
{
|
||||||
return LoanOrdersTable::configure($table);
|
return LoanOrdersTable::configure($table);
|
||||||
@@ -75,7 +70,6 @@ class LoanOrderResource extends Resource
|
|||||||
return [
|
return [
|
||||||
'index' => ListLoanOrders::route('/'),
|
'index' => ListLoanOrders::route('/'),
|
||||||
'create' => CreateLoanOrder::route('/create'),
|
'create' => CreateLoanOrder::route('/create'),
|
||||||
'view' => ViewLoanOrder::route('/{record}'),
|
|
||||||
'edit' => EditLoanOrder::route('/{record}/edit'),
|
'edit' => EditLoanOrder::route('/{record}/edit'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class EditLoanOrder extends EditRecord
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
ViewAction::make(),
|
|
||||||
DeleteAction::make(),
|
DeleteAction::make(),
|
||||||
ForceDeleteAction::make(),
|
ForceDeleteAction::make(),
|
||||||
RestoreAction::make(),
|
RestoreAction::make(),
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Filament\Clusters\Loans\LoanOrders\Tables;
|
namespace App\Filament\Clusters\Loans\LoanOrders\Tables;
|
||||||
|
|
||||||
use App\Modules\DefaultQueryForResourceIndex\Repositories\DefaultQueryForResourceIndexRepository;
|
use App\Modules\DefaultQueryForResourceIndex\Repositories\DefaultQueryForResourceIndexRepository;
|
||||||
|
use App\Modules\OrderStatus\Repositories\OrderStatusRepository;
|
||||||
|
use App\Modules\Region\Repositories\RegionRepository;
|
||||||
use Filament\Actions\BulkActionGroup;
|
use Filament\Actions\BulkActionGroup;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
@@ -37,7 +39,8 @@ class LoanOrdersTable
|
|||||||
TextColumn::make('region')
|
TextColumn::make('region')
|
||||||
->label(__('Region'))
|
->label(__('Region'))
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable()
|
||||||
|
->formatStateUsing(fn (string $state) => RegionRepository::label($state)),
|
||||||
|
|
||||||
TextColumn::make('branch.name')
|
TextColumn::make('branch.name')
|
||||||
->label(__('Branch'))
|
->label(__('Branch'))
|
||||||
@@ -60,9 +63,15 @@ class LoanOrdersTable
|
|||||||
|
|
||||||
TextColumn::make('status')
|
TextColumn::make('status')
|
||||||
->label(__('Status'))
|
->label(__('Status'))
|
||||||
|
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state))
|
||||||
->sortable()
|
->sortable()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
|
TextColumn::make('status')
|
||||||
|
->badge()
|
||||||
|
->color(OrderStatusRepository::statusColorMatching())
|
||||||
|
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state)),
|
||||||
|
|
||||||
TextColumn::make('created_at')
|
TextColumn::make('created_at')
|
||||||
->label(__('Created At'))
|
->label(__('Created At'))
|
||||||
->dateTime()
|
->dateTime()
|
||||||
@@ -85,7 +94,6 @@ class LoanOrdersTable
|
|||||||
TrashedFilter::make(),
|
TrashedFilter::make(),
|
||||||
])
|
])
|
||||||
->recordActions([
|
->recordActions([
|
||||||
ViewAction::make(),
|
|
||||||
EditAction::make(),
|
EditAction::make(),
|
||||||
])
|
])
|
||||||
->toolbarActions([
|
->toolbarActions([
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
namespace App\Filament\Clusters\Loans\Resources\LoanPaidOffLetters\Tables;
|
namespace App\Filament\Clusters\Loans\Resources\LoanPaidOffLetters\Tables;
|
||||||
|
|
||||||
use App\Modules\DefaultQueryForResourceIndex\Repositories\DefaultQueryForResourceIndexRepository;
|
use App\Modules\DefaultQueryForResourceIndex\Repositories\DefaultQueryForResourceIndexRepository;
|
||||||
|
use App\Modules\OrderStatus\Repositories\OrderStatusRepository;
|
||||||
|
use App\Modules\Region\Repositories\RegionRepository;
|
||||||
use Filament\Actions\BulkActionGroup;
|
use Filament\Actions\BulkActionGroup;
|
||||||
use Filament\Actions\DeleteBulkAction;
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
@@ -24,7 +26,8 @@ class LoanPaidOffLettersTable
|
|||||||
->sortable(),
|
->sortable(),
|
||||||
|
|
||||||
TextColumn::make('region')
|
TextColumn::make('region')
|
||||||
->label(__('Region')),
|
->label(__('Region'))
|
||||||
|
->formatStateUsing(fn (string $state) => RegionRepository::label($state)),
|
||||||
|
|
||||||
TextColumn::make('branch.name')
|
TextColumn::make('branch.name')
|
||||||
->label(__('Branch')),
|
->label(__('Branch')),
|
||||||
@@ -38,9 +41,14 @@ class LoanPaidOffLettersTable
|
|||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
TextColumn::make('phone')
|
TextColumn::make('phone')
|
||||||
|
->label(__('Phone'))
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
TextColumn::make('status')
|
TextColumn::make('status')
|
||||||
|
->label(__('Status'))
|
||||||
|
->formatStateUsing(fn (string $state) => OrderStatusRepository::statusFormatted($state))
|
||||||
|
->sortable()
|
||||||
|
->badge()
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
TextColumn::make('created_at')
|
TextColumn::make('created_at')
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Modules\OrderStatus\Repositories;
|
namespace App\Modules\OrderStatus\Repositories;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
|
||||||
class OrderStatusRepository
|
class OrderStatusRepository
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -94,20 +96,17 @@ class OrderStatusRepository
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* HEX Colors
|
* Status color matching
|
||||||
*
|
|
||||||
* @return array<string, string>
|
|
||||||
*/
|
*/
|
||||||
public static function statusColors(): array
|
public static function statusColorMatching(): Closure
|
||||||
{
|
{
|
||||||
return [
|
return fn (string $state): string => match ($state) {
|
||||||
null => '-',
|
self::PENDING => 'warning',
|
||||||
self::PENDING => '#F5573B',
|
self::REGISTER => 'info',
|
||||||
self::REGISTER => '#F2CB22',
|
self::PROCESSING => 'primary',
|
||||||
self::PROCESSING => '#8FC15D',
|
self::COMPLETED => 'success',
|
||||||
self::COMPLETED => '#098F56',
|
self::CANCELLED => 'danger',
|
||||||
self::CANCELLED => '#d70206',
|
};
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user