wip
This commit is contained in:
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')
|
||||
->icon('phosphor-upload')
|
||||
->label('Import')
|
||||
->modalDescription('Separator comma ",", First line: "name,player_id"')
|
||||
->modalDescription('Separator comma ",", First line: "name,tm_player_id"')
|
||||
->importer(PlayerImporter::class),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ class PlayerForm
|
||||
return $schema
|
||||
->components([
|
||||
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([
|
||||
TextColumn::make('name')
|
||||
->searchable(),
|
||||
TextColumn::make('id')
|
||||
TextColumn::make('tm_player_id')
|
||||
->badge()
|
||||
->searchable(),
|
||||
]),
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class StatistikoDetailsTable
|
||||
->paginationPageOptions([8, 16, 24, 36])
|
||||
->columns([
|
||||
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('full_name')->color('gray')->searchable(),
|
||||
TextColumn::make('birthdate')->date()->prefix('Birthdate: '),
|
||||
|
||||
+3
-2
@@ -16,8 +16,10 @@ class StatistikoPlayerForm
|
||||
'default' => 2,
|
||||
'xl' => 4,
|
||||
])->schema([
|
||||
TextInput::make('sport_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('playersubstitute_id'),
|
||||
TextInput::make('goals'),
|
||||
@@ -75,7 +77,6 @@ class StatistikoPlayerForm
|
||||
TextInput::make('subtype_event_during_the_match'),
|
||||
TextInput::make('player_position'),
|
||||
TextInput::make('playerrating_value'),
|
||||
TextInput::make('tm_player_id'),
|
||||
]),
|
||||
])->columns(1);
|
||||
}
|
||||
|
||||
+2
-1
@@ -19,7 +19,8 @@ class StatistikoPlayersTable
|
||||
->label('Player')
|
||||
->searchable()
|
||||
->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.away.name')->searchable(),
|
||||
])
|
||||
|
||||
@@ -22,7 +22,7 @@ class ImportDetails
|
||||
|
||||
$row = array_values($row);
|
||||
|
||||
StatistikoDetail::where('player_id', $row[0])
|
||||
StatistikoDetail::where('tm_player_id', $row[0])
|
||||
->update(
|
||||
[
|
||||
'name' => $row[1],
|
||||
|
||||
@@ -13,7 +13,7 @@ class StatistikoDetail extends Model
|
||||
protected $table = 'details';
|
||||
|
||||
protected $fillable = [
|
||||
'player_id',
|
||||
'tm_player_id',
|
||||
'name',
|
||||
'full_name',
|
||||
'birthdate',
|
||||
|
||||
@@ -11,8 +11,10 @@ class StatistikoPlayer extends Model
|
||||
protected $table = 'players';
|
||||
|
||||
protected $fillable = [
|
||||
'sport_id',
|
||||
'match_id',
|
||||
'player_id',
|
||||
'ss_player_id',
|
||||
'tm_player_id',
|
||||
'activeteam_id',
|
||||
'playersubstitute_id',
|
||||
'goals',
|
||||
@@ -80,6 +82,6 @@ class StatistikoPlayer extends Model
|
||||
|
||||
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
|
||||
{
|
||||
Schema::create('details', function (Blueprint $collection) {
|
||||
$collection->unique('player_id');
|
||||
$collection->unique('tm_player_id');
|
||||
$collection->index('name');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -15,7 +15,8 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('players', function (Blueprint $collection) {
|
||||
$collection->index('match_id');
|
||||
$collection->index('player_id');
|
||||
$collection->index('ss_player_id');
|
||||
$collection->index('tm_player_id');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user