Add navigation sort order to clusters and update profile panel sorting
This commit is contained in:
@@ -9,6 +9,8 @@ use Filament\Support\Icons\Heroicon;
|
|||||||
|
|
||||||
class CardsCluster extends Cluster
|
class CardsCluster extends Cluster
|
||||||
{
|
{
|
||||||
|
protected static ?int $navigationSort = 1;
|
||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCreditCard;
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCreditCard;
|
||||||
|
|
||||||
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Start;
|
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Start;
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Filament\Support\Icons\Heroicon;
|
|||||||
|
|
||||||
class LoansCluster extends Cluster
|
class LoansCluster extends Cluster
|
||||||
{
|
{
|
||||||
|
protected static ?int $navigationSort = 2;
|
||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBanknotes;
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBanknotes;
|
||||||
|
|
||||||
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
|
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments;
|
||||||
|
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Clusters\Cluster;
|
||||||
|
use Filament\Pages\Enums\SubNavigationPosition;
|
||||||
|
use Filament\Support\Icons\Heroicon;
|
||||||
|
|
||||||
|
class OnlinePaymentsCluster extends Cluster
|
||||||
|
{
|
||||||
|
protected static ?int $navigationSort = 5;
|
||||||
|
|
||||||
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedServerStack;
|
||||||
|
|
||||||
|
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
|
||||||
|
|
||||||
|
public static function getNavigationLabel(): string
|
||||||
|
{
|
||||||
|
return __('Online payments');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\OnlinePayments\OnlinePaymentsCluster;
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Pages\CreateOnlinePayment;
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Pages\EditOnlinePayment;
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Pages\ListOnlinePayments;
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Schemas\OnlinePaymentForm;
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Tables\OnlinePaymentsTable;
|
||||||
|
use App\Modules\OnlinePayment\Models\OnlinePayment;
|
||||||
|
use BackedEnum;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
use Filament\Support\Icons\Heroicon;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class OnlinePaymentResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = OnlinePayment::class;
|
||||||
|
|
||||||
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
||||||
|
|
||||||
|
protected static ?string $cluster = OnlinePaymentsCluster::class;
|
||||||
|
|
||||||
|
protected static ?string $recordTitleAttribute = 'orderId';
|
||||||
|
|
||||||
|
public static function form(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return OnlinePaymentForm::configure($schema);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return OnlinePaymentsTable::configure($table);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => ListOnlinePayments::route('/'),
|
||||||
|
'create' => CreateOnlinePayment::route('/create'),
|
||||||
|
'edit' => EditOnlinePayment::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\OnlinePaymentResource;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateOnlinePayment extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = OnlinePaymentResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\OnlinePaymentResource;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditOnlinePayment extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = OnlinePaymentResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Pages;
|
||||||
|
|
||||||
|
use App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\OnlinePaymentResource;
|
||||||
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListOnlinePayments extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = OnlinePaymentResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Schemas;
|
||||||
|
|
||||||
|
use Filament\Schemas\Schema;
|
||||||
|
|
||||||
|
class OnlinePaymentForm
|
||||||
|
{
|
||||||
|
public static function configure(Schema $schema): Schema
|
||||||
|
{
|
||||||
|
return $schema
|
||||||
|
->components([
|
||||||
|
//
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Clusters\OnlinePayments\Resources\OnlinePayments\Tables;
|
||||||
|
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class OnlinePaymentsTable
|
||||||
|
{
|
||||||
|
public static function configure(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->recordActions([
|
||||||
|
EditAction::make(),
|
||||||
|
])
|
||||||
|
->toolbarActions([
|
||||||
|
BulkActionGroup::make([
|
||||||
|
DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,6 +9,8 @@ use Filament\Support\Icons\Heroicon;
|
|||||||
|
|
||||||
class UsersCluster extends Cluster
|
class UsersCluster extends Cluster
|
||||||
{
|
{
|
||||||
|
protected static ?int $navigationSort = 6;
|
||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers;
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedUsers;
|
||||||
|
|
||||||
protected static string|BackedEnum|null $activeNavigationIcon = Heroicon::Users;
|
protected static string|BackedEnum|null $activeNavigationIcon = Heroicon::Users;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Filament\Pages\Enums\SubNavigationPosition;
|
|||||||
|
|
||||||
class VisaMasterPaymentsCluster extends Cluster
|
class VisaMasterPaymentsCluster extends Cluster
|
||||||
{
|
{
|
||||||
|
protected static ?int $navigationSort = 3;
|
||||||
|
|
||||||
protected static string|BackedEnum|null $navigationIcon = 'icon-visa-plain';
|
protected static string|BackedEnum|null $navigationIcon = 'icon-visa-plain';
|
||||||
|
|
||||||
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
|
protected static ?SubNavigationPosition $subNavigationPosition = SubNavigationPosition::Top;
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ class WorkPanelProvider extends PanelProvider
|
|||||||
->setTitle(__('My profile'))
|
->setTitle(__('My profile'))
|
||||||
->setNavigationLabel(__('My profile'))
|
->setNavigationLabel(__('My profile'))
|
||||||
->setIcon('heroicon-o-user-circle')
|
->setIcon('heroicon-o-user-circle')
|
||||||
|
->setSort(4)
|
||||||
->shouldShowEditProfileForm(false)
|
->shouldShowEditProfileForm(false)
|
||||||
->customProfileComponents([
|
->customProfileComponents([
|
||||||
UserProfileFields::class,
|
UserProfileFields::class,
|
||||||
|
|||||||
Reference in New Issue
Block a user