This commit is contained in:
salam committed 2026-05-21 11:44:44 +02:00
1 parent 0afb7944bc
commit 01e22c4c6b
11 files changed
+19 -13

No files matched your search

@@ -21,7 +21,7 @@ class ListPlayers extends ListRecords
ImportAction::make('importPlayer') ImportAction::make('importPlayer')
->icon('phosphor-upload') ->icon('phosphor-upload')
->label('Import') ->label('Import')
->modalDescription('Separator comma ",", First line: "name,player_id"') ->modalDescription('Separator comma ",", First line: "name,tm_player_id"')
->importer(PlayerImporter::class), ->importer(PlayerImporter::class),
]; ];
} }
@@ -12,7 +12,8 @@ class PlayerForm
return $schema return $schema
->components([ ->components([
TextInput::make('name'), TextInput::make('name'),
TextInput::make('player_id')->afterLabel(['Must be unique']), TextInput::make('tm_player_id')->afterLabel(['Must be unique']),
TextInput::make('ss_player_id')->afterLabel(['Must be unique']),
]); ]);
} }
} }
@@ -18,7 +18,7 @@ class PlayersTable
Stack::make([ Stack::make([
TextColumn::make('name') TextColumn::make('name')
->searchable(), ->searchable(),
TextColumn::make('id') TextColumn::make('tm_player_id')
->badge() ->badge()
->searchable(), ->searchable(),
]), ]),
@@ -19,7 +19,7 @@ class StatistikoDetailsTable
->paginationPageOptions([8, 16, 24, 36]) ->paginationPageOptions([8, 16, 24, 36])
->columns([ ->columns([
Stack::make([ Stack::make([
TextColumn::make('player_id')->prefix('Id: ')->searchable()->color('success')->icon('phosphor-copy')->copyable(), TextColumn::make('tm_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('name')->searchable()->prefix('Name: ')->color('primary')->icon('phosphor-copy')->copyable(),
TextColumn::make('full_name')->color('gray')->searchable(), TextColumn::make('full_name')->color('gray')->searchable(),
TextColumn::make('birthdate')->date()->prefix('Birthdate: '), TextColumn::make('birthdate')->date()->prefix('Birthdate: '),
@@ -16,8 +16,10 @@ class StatistikoPlayerForm
'default' => 2, 'default' => 2,
'xl' => 4, 'xl' => 4,
])->schema([ ])->schema([
TextInput::make('sport_id'),
TextInput::make('match_id'), TextInput::make('match_id'),
TextInput::make('player_id'), TextInput::make('ss_player_id'),
TextInput::make('tm_player_id'),
TextInput::make('activeteam_id'), TextInput::make('activeteam_id'),
TextInput::make('playersubstitute_id'), TextInput::make('playersubstitute_id'),
TextInput::make('goals'), TextInput::make('goals'),
@@ -75,7 +77,6 @@ class StatistikoPlayerForm
TextInput::make('subtype_event_during_the_match'), TextInput::make('subtype_event_during_the_match'),
TextInput::make('player_position'), TextInput::make('player_position'),
TextInput::make('playerrating_value'), TextInput::make('playerrating_value'),
TextInput::make('tm_player_id'),
]), ]),
])->columns(1); ])->columns(1);
} }
@@ -19,7 +19,8 @@ class StatistikoPlayersTable
->label('Player') ->label('Player')
->searchable() ->searchable()
->tooltip(fn ($record) => $record->details->full_name), ->tooltip(fn ($record) => $record->details->full_name),
TextColumn::make('player_id')->searchable(), TextColumn::make('tm_player_id')->searchable(),
TextColumn::make('ss_player_id')->searchable(),
TextColumn::make('event.home.name')->searchable(), TextColumn::make('event.home.name')->searchable(),
TextColumn::make('event.away.name')->searchable(), TextColumn::make('event.away.name')->searchable(),
]) ])
@@ -22,7 +22,7 @@ class ImportDetails
$row = array_values($row); $row = array_values($row);
StatistikoDetail::where('player_id', $row[0]) StatistikoDetail::where('tm_player_id', $row[0])
->update( ->update(
[ [
'name' => $row[1], 'name' => $row[1],
+1 -1
View File
@@ -13,7 +13,7 @@ class StatistikoDetail extends Model
protected $table = 'details'; protected $table = 'details';
protected $fillable = [ protected $fillable = [
'player_id', 'tm_player_id',
'name', 'name',
'full_name', 'full_name',
'birthdate', 'birthdate',
+4 -2
View File
@@ -11,8 +11,10 @@ class StatistikoPlayer extends Model
protected $table = 'players'; protected $table = 'players';
protected $fillable = [ protected $fillable = [
'sport_id',
'match_id', 'match_id',
'player_id', 'ss_player_id',
'tm_player_id',
'activeteam_id', 'activeteam_id',
'playersubstitute_id', 'playersubstitute_id',
'goals', 'goals',
@@ -80,6 +82,6 @@ class StatistikoPlayer extends Model
public function details() public function details()
{ {
return $this->belongsTo(StatistikoDetail::class, 'player_id', 'player_id'); return $this->belongsTo(StatistikoDetail::class, 'tm_player_id', 'tm_player_id');
} }
} }
@@ -14,7 +14,7 @@ return new class extends Migration
public function up(): void public function up(): void
{ {
Schema::create('details', function (Blueprint $collection) { Schema::create('details', function (Blueprint $collection) {
$collection->unique('player_id'); $collection->unique('tm_player_id');
$collection->index('name'); $collection->index('name');
}); });
} }
@@ -15,7 +15,8 @@ return new class extends Migration
{ {
Schema::create('players', function (Blueprint $collection) { Schema::create('players', function (Blueprint $collection) {
$collection->index('match_id'); $collection->index('match_id');
$collection->index('player_id'); $collection->index('ss_player_id');
$collection->index('tm_player_id');
}); });
} }