fix player marcatori names
This commit is contained in:
1 parent
3149fa6c12
commit
d5563154e0
27 files changed
+508
-339
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoDetails\StatistikoDetailResource;
|
||||
use Filament\Resources\Pages\CreateRecord;
|
||||
|
||||
class CreateStatistikoDetail extends CreateRecord
|
||||
{
|
||||
protected static string $resource = StatistikoDetailResource::class;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoDetails\StatistikoDetailResource;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditStatistikoDetails extends EditRecord
|
||||
{
|
||||
protected static string $resource = StatistikoDetailResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
DeleteAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoDetails\StatistikoDetailResource;
|
||||
use App\Models\StatistikoDetail;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
class ListStatistikoDetails extends ListRecords
|
||||
{
|
||||
protected static string $resource = StatistikoDetailResource::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('truncate')
|
||||
->icon('phosphor-trash')
|
||||
->requiresConfirmation()
|
||||
->color('danger')
|
||||
->action(function () {
|
||||
StatistikoDetail::truncate();
|
||||
}),
|
||||
CreateAction::make()
|
||||
->label('New')
|
||||
->icon('phosphor-plus'),
|
||||
];
|
||||
}
|
||||
}
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Schema;
|
||||
|
||||
class StatistikoDetailForm
|
||||
{
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
Grid::make([
|
||||
'default' => 2,
|
||||
'xl' => 4,
|
||||
])->schema([
|
||||
TextInput::make('id_giocatore')->required(),
|
||||
TextInput::make('giocatore')->required(),
|
||||
TextInput::make('nome_completo'),
|
||||
DatePicker::make('data_di_nascita'),
|
||||
TextInput::make('altezza'),
|
||||
TextInput::make('nazionalita'),
|
||||
TextInput::make('posizione'),
|
||||
TextInput::make('sport_radar_id'),
|
||||
TextInput::make('id_squadra_tm'),
|
||||
TextInput::make('rigorista'),
|
||||
TextInput::make('national_team_id'),
|
||||
DatePicker::make('data_aggiornamento'),
|
||||
TextInput::make('league_code'),
|
||||
TextInput::make('team_code'),
|
||||
TextInput::make('team_name'),
|
||||
]),
|
||||
])->columns(1);
|
||||
}
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoDetails;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Pages\ListStatistikoDetails;
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Schemas\StatistikoDetailForm;
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Tables\StatistikoDetailsTable;
|
||||
use App\Filament\Clusters\StaticData\StaticDataCluster;
|
||||
use App\Models\StatistikoDetail;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Tables\Table;
|
||||
use UnitEnum;
|
||||
|
||||
class StatistikoDetailResource extends Resource
|
||||
{
|
||||
protected static ?string $model = StatistikoDetail::class;
|
||||
|
||||
protected static ?string $navigationLabel = 'Details';
|
||||
|
||||
protected static ?string $modelLabel = 'Details';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?int $navigationSort = 4;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'giocatore';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
return StatistikoDetailForm::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return StatistikoDetailsTable::configure($table);
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => ListStatistikoDetails::route('/'),
|
||||
];
|
||||
}
|
||||
|
||||
public static function getNavigationBadge(): ?string
|
||||
{
|
||||
return parent::getEloquentQuery()->count();
|
||||
}
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoDetails\Tables;
|
||||
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\Layout\Stack;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class StatistikoDetailsTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->poll('10sec')
|
||||
->striped()
|
||||
->defaultPaginationPageOption(8)
|
||||
->paginationPageOptions([8, 16, 24, 36])
|
||||
->columns([
|
||||
Stack::make([
|
||||
TextColumn::make('player_id')->prefix('Id: ')->searchable()->color('success')->icon('phosphor-copy')->copyable(),
|
||||
TextColumn::make('name')->searchable()->prefix('Name: ')->color('primary')->icon('phosphor-copy')->copyable(),
|
||||
TextColumn::make('full_name')->color('gray')->searchable(),
|
||||
TextColumn::make('birthdate')->date()->prefix('Birthdate: '),
|
||||
TextColumn::make('height')->prefix('Height: ')->suffix(' cm'),
|
||||
TextColumn::make('nationality')->prefix('Nationality: '),
|
||||
TextColumn::make('position')->prefix('Position: '),
|
||||
TextColumn::make('sport_radar_id')->searchable()->prefix('Sport Radar Id: ')->icon('phosphor-copy')->copyable(),
|
||||
TextColumn::make('id_squadra_tm')->prefix('Team Id TM: '),
|
||||
TextColumn::make('rigorist')->prefix('Rigorist: '),
|
||||
TextColumn::make('national_team_id')->prefix('National Team Id: '),
|
||||
TextColumn::make('last_update')->date()->prefix('Last Update: '),
|
||||
TextColumn::make('created_at')->date()->prefix('Created: '),
|
||||
TextColumn::make('updated_at')->date()->prefix('Updated: '),
|
||||
// TextColumn::make('league_code')->prefix('League: '),
|
||||
// TextColumn::make('team_code')->prefix('Team Code: '),
|
||||
// TextColumn::make('team_name')->prefix('Team Name: '),
|
||||
]),
|
||||
])
|
||||
->contentGrid([
|
||||
'md' => 2,
|
||||
'xl' => 4,
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()->hiddenLabel(),
|
||||
DeleteAction::make()->hiddenLabel(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -17,7 +17,7 @@ class StatistikoImportForm
|
||||
->required()
|
||||
->allowHtml()
|
||||
->options([
|
||||
'personal' => '<span class="text-blue-500">Personals</span>',
|
||||
'details' => '<span class="text-blue-500">Details</span>',
|
||||
'events' => '<span class="text-green-500">Events</span>',
|
||||
'fixtures' => '<span class="text-orange-500">Fixtures</span>',
|
||||
'player' => '<span class="text-pink-600">Player</span>',
|
||||
|
||||
+2
-2
@@ -28,10 +28,10 @@ class StatistikoImportsTable
|
||||
->width('2rem')
|
||||
->allowOptionsHtml()
|
||||
->options([
|
||||
'personal' => '<span class="text-blue-500">Personal</span>',
|
||||
'details' => '<span class="text-blue-500">Details</span>',
|
||||
'events' => '<span class="text-green-500">Events</span>',
|
||||
'fixtures' => '<span class="text-orange-500">Fixtures</span>',
|
||||
'player' => '<span class="text-amber-500">Player</span>',
|
||||
'player' => '<span class="text-pink-600">Player</span>',
|
||||
]),
|
||||
TextColumn::make('file_name_original')
|
||||
->searchable()
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlaye
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
|
||||
class EditStatistikoPlayers extends EditRecord
|
||||
class EditStatistikoPlayer extends EditRecord
|
||||
{
|
||||
protected static string $resource = StatistikoPlayerResource::class;
|
||||
|
||||
+1
-12
@@ -3,8 +3,6 @@
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlayerResource;
|
||||
use App\Models\StatistikoPlayer;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
|
||||
@@ -15,16 +13,7 @@ class ListStatistikoPlayers extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('truncate')
|
||||
->icon('phosphor-trash')
|
||||
->requiresConfirmation()
|
||||
->color('danger')
|
||||
->action(function () {
|
||||
StatistikoPlayer::truncate();
|
||||
}),
|
||||
CreateAction::make()
|
||||
->label('New')
|
||||
->icon('phosphor-plus'),
|
||||
CreateAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
+61
-20
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Schemas;
|
||||
|
||||
use Filament\Forms\Components\DatePicker;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Schema;
|
||||
@@ -16,25 +15,67 @@ class StatistikoPlayerForm
|
||||
Grid::make([
|
||||
'default' => 2,
|
||||
'xl' => 4,
|
||||
])
|
||||
->schema([
|
||||
TextInput::make('id_giocatore')->required(),
|
||||
TextInput::make('giocatore')->required(),
|
||||
TextInput::make('nome_completo'),
|
||||
DatePicker::make('data_di_nascita'),
|
||||
TextInput::make('altezza'),
|
||||
TextInput::make('nazionalita'),
|
||||
TextInput::make('posizione'),
|
||||
TextInput::make('sport_radar_id'),
|
||||
TextInput::make('id_squadra_tm'),
|
||||
TextInput::make('rigorista'),
|
||||
TextInput::make('national_team_id'),
|
||||
DatePicker::make('data_aggiornamento'),
|
||||
TextInput::make('league_code'),
|
||||
TextInput::make('team_code'),
|
||||
TextInput::make('team_name'),
|
||||
]),
|
||||
|
||||
])->schema([
|
||||
TextInput::make('match_id'),
|
||||
TextInput::make('player_id'),
|
||||
TextInput::make('playersubstitute_id'),
|
||||
TextInput::make('goals'),
|
||||
TextInput::make('assists'),
|
||||
TextInput::make('own_goals'),
|
||||
TextInput::make('shots_on_target'),
|
||||
TextInput::make('shots_off_target'),
|
||||
TextInput::make('shots_blocked'),
|
||||
TextInput::make('fouls'),
|
||||
TextInput::make('was_fouled'),
|
||||
TextInput::make('offsides'),
|
||||
TextInput::make('possessions_lost'),
|
||||
TextInput::make('total_tackles'),
|
||||
TextInput::make('touches'),
|
||||
TextInput::make('total_cross'),
|
||||
TextInput::make('cross_done'),
|
||||
TextInput::make('total_dribbles'),
|
||||
TextInput::make('dribbles_won'),
|
||||
TextInput::make('total_ground_duels'),
|
||||
TextInput::make('total_ground_duels_won'),
|
||||
TextInput::make('total_aerial_duels'),
|
||||
TextInput::make('total_duels_aerial_won'),
|
||||
TextInput::make('total_pass'),
|
||||
TextInput::make('pass'),
|
||||
TextInput::make('total_long_balls'),
|
||||
TextInput::make('long_balls'),
|
||||
TextInput::make('blocked_shots'),
|
||||
TextInput::make('clearances'),
|
||||
TextInput::make('dribbled_past'),
|
||||
TextInput::make('hit_woodwork'),
|
||||
TextInput::make('interceptions'),
|
||||
TextInput::make('key_pass'),
|
||||
TextInput::make('last_man_tackle'),
|
||||
TextInput::make('dispossessed'),
|
||||
TextInput::make('clearance_off_line'),
|
||||
TextInput::make('bcc'),
|
||||
TextInput::make('bcm'),
|
||||
TextInput::make('errors_lead_to_a_goal'),
|
||||
TextInput::make('errors_lead_to_a_shot'),
|
||||
TextInput::make('penalty_committed'),
|
||||
TextInput::make('penalty_miss'),
|
||||
TextInput::make('penalty_save'),
|
||||
TextInput::make('penalty_won'),
|
||||
TextInput::make('saves'),
|
||||
TextInput::make('saves_from_in_box'),
|
||||
TextInput::make('total_runs_out'),
|
||||
TextInput::make('runs_out'),
|
||||
TextInput::make('punches'),
|
||||
TextInput::make('good_high_claim'),
|
||||
TextInput::make('minutes_played'),
|
||||
TextInput::make('lineup'),
|
||||
TextInput::make('minute_event_during_the_match'),
|
||||
TextInput::make('type_event_during_the_match'),
|
||||
TextInput::make('description_event_during_the_match'),
|
||||
TextInput::make('subtype_event_during_the_match'),
|
||||
TextInput::make('player_position'),
|
||||
TextInput::make('playerrating_value'),
|
||||
TextInput::make('tm_player_id'),
|
||||
]),
|
||||
])->columns(1);
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -16,17 +16,17 @@ class StatistikoPlayerResource extends Resource
|
||||
{
|
||||
protected static ?string $model = StatistikoPlayer::class;
|
||||
|
||||
protected static ?string $navigationLabel = 'Personal Detail';
|
||||
protected static ?string $navigationLabel = 'Player';
|
||||
|
||||
protected static ?string $modelLabel = 'Personal Detail';
|
||||
protected static ?string $modelLabel = 'Player';
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
|
||||
|
||||
protected static ?string $cluster = StaticDataCluster::class;
|
||||
|
||||
protected static ?int $navigationSort = 4;
|
||||
protected static ?int $navigationSort = 5;
|
||||
|
||||
protected static ?string $recordTitleAttribute = 'giocatore';
|
||||
protected static ?string $recordTitleAttribute = 'player.name';
|
||||
|
||||
public static function form(Schema $schema): Schema
|
||||
{
|
||||
|
||||
+15
-30
@@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Tables;
|
||||
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\Layout\Stack;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
@@ -13,38 +13,23 @@ class StatistikoPlayersTable
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->poll('10sec')
|
||||
->striped()
|
||||
->defaultPaginationPageOption(8)
|
||||
->paginationPageOptions([8, 16, 24, 36])
|
||||
->columns([
|
||||
Stack::make([
|
||||
TextColumn::make('player_id')->prefix('Id: ')->searchable()->color('success')->icon('phosphor-copy')->copyable(),
|
||||
TextColumn::make('name')->searchable()->prefix('Name: ')->color('primary')->icon('phosphor-copy')->copyable(),
|
||||
TextColumn::make('full_name')->color('gray')->searchable(),
|
||||
TextColumn::make('birthdate')->date()->prefix('Birthdate: '),
|
||||
TextColumn::make('height')->prefix('Height: ')->suffix(' cm'),
|
||||
TextColumn::make('nationality')->prefix('Nationality: '),
|
||||
TextColumn::make('position')->prefix('Position: '),
|
||||
TextColumn::make('sport_radar_id')->searchable()->prefix('Sport Radar Id: ')->icon('phosphor-copy')->copyable(),
|
||||
TextColumn::make('id_squadra_tm')->prefix('Team Id TM: '),
|
||||
TextColumn::make('rigorist')->prefix('Rigorist: '),
|
||||
TextColumn::make('national_team_id')->prefix('National Team Id: '),
|
||||
TextColumn::make('last_update')->date()->prefix('Last Update: '),
|
||||
TextColumn::make('created_at')->date()->prefix('Created: '),
|
||||
TextColumn::make('updated_at')->date()->prefix('Updated: '),
|
||||
// TextColumn::make('league_code')->prefix('League: '),
|
||||
// TextColumn::make('team_code')->prefix('Team Code: '),
|
||||
// TextColumn::make('team_name')->prefix('Team Name: '),
|
||||
]),
|
||||
TextColumn::make('match_id')->searchable(),
|
||||
TextColumn::make('player_id')->searchable(),
|
||||
TextColumn::make('event.home.name')->searchable(),
|
||||
TextColumn::make('event.away.name')->searchable(),
|
||||
TextColumn::make('details.name')->searchable(),
|
||||
])
|
||||
->contentGrid([
|
||||
'md' => 2,
|
||||
'xl' => 4,
|
||||
->filters([
|
||||
//
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make()->hiddenLabel(),
|
||||
DeleteAction::make()->hiddenLabel(),
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user