wip add storage to git
This commit is contained in:
1 parent
5fe81c3870
commit
21faf46f76
149 files changed
+1586
-43
No files matched your search
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Bettypes;
|
||||
|
||||
use App\Filament\Clusters\Administrator\AdministratorCluster;
|
||||
use App\Filament\Resources\Bettypes\Pages\ListBettypes;
|
||||
use App\Filament\Resources\Bettypes\Schemas\BettypeForm;
|
||||
use App\Filament\Resources\Bettypes\Tables\BettypesTable;
|
||||
use App\Models\Bettype;
|
||||
use BackedEnum;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BettypeResource extends Resource
|
||||
{
|
||||
protected static ?string $model = Bettype::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::AdjustmentsHorizontal;
|
||||
|
||||
protected static ?string $cluster = AdministratorCluster::class;
|
||||
|
||||
protected static string|\UnitEnum|null $navigationGroup = 'Static Data';
|
||||
|
||||
protected static ?string $navigationLabel = 'Bettype';
|
||||
|
||||
protected static ?string $modelLabel = 'Bettype';
|
||||
|
||||
protected static ?string $title = 'Bettype';
|
||||
|
||||
protected static ?string $pluralModelLabel = 'Bettypes';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return BettypeForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return BettypesTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getRelations(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListBettypes::route('/'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Bettypes\Pages;
|
||||
|
||||
use App\Filament\Resources\Bettypes\BettypeResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateBettype extends CreateRecord
|
||||
{
|
||||
protected static string $resource = BettypeResource::class;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Bettypes\Pages;
|
||||
|
||||
use App\Filament\Resources\Bettypes\BettypeResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditBettype extends EditRecord
|
||||
{
|
||||
protected static string $resource = BettypeResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Bettypes\Pages;
|
||||
|
||||
use App\Filament\Resources\Bettypes\BettypeResource;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListBettypes extends ListRecords
|
||||
{
|
||||
protected static string $resource = BettypeResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Bettypes\Schemas;
|
||||
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class BettypeForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
//
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\Bettypes\Tables;
|
||||
|
||||
use App\Models\Sport;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class BettypesTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('bettype_id')
|
||||
->width('1rem')
|
||||
->searchable()->label('Id'),
|
||||
IconColumn::make('sport.icon')
|
||||
->label('')
|
||||
->width('1rem')
|
||||
->icon(function ($record): string {
|
||||
return $record->sport->icon;
|
||||
}),
|
||||
TextColumn::make('sport.name'),
|
||||
TextColumn::make('name')->searchable(),
|
||||
IconColumn::make('ft')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
IconColumn::make('ht')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
IconColumn::make('h2')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
IconColumn::make('co')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
IconColumn::make('q1')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
IconColumn::make('p1')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
IconColumn::make('q1')->boolean()->trueIcon('phosphor-check-circle-fill')->falseIcon('phosphor-circle')->falseColor('gray'),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('sport_id')
|
||||
->label('Sport')
|
||||
->options(fn () => Sport::where('is_active', 1)->pluck('name', 'id')
|
||||
->toArray()),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user