wip SofaScorePlayerPosition
This commit is contained in:
1 parent
22d719aae1
commit
971d97a573
6 files changed
+328
-9
No files matched your search
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class SofaScorePlayerPosition extends Model
|
||||||
|
{
|
||||||
|
protected $primaryKey = 'ss_code';
|
||||||
|
|
||||||
|
public $incrementing = false;
|
||||||
|
|
||||||
|
protected $keyType = 'string';
|
||||||
|
|
||||||
|
protected $fillable = [
|
||||||
|
'ss_code',
|
||||||
|
'description',
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@ class StatistikoDetail extends Model
|
|||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'ss_player_id',
|
'ss_player_id',
|
||||||
'player_name',
|
'player_name',
|
||||||
'tx_team_id',
|
|
||||||
'ss_national_team_id',
|
'ss_national_team_id',
|
||||||
'team_name',
|
'team_name',
|
||||||
'birthday',
|
'birthday',
|
||||||
@@ -40,4 +39,9 @@ class StatistikoDetail extends Model
|
|||||||
{
|
{
|
||||||
return $this->hasMany(SofaScorePlayerPerSeason::class, 'ss_player_id', 'ss_player_id');
|
return $this->hasMany(SofaScorePlayerPerSeason::class, 'ss_player_id', 'ss_player_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function ss_code()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(SofaScorePlayerPosition::class, 'position', 'ss_code');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Generated
+12
-8
@@ -4444,24 +4444,24 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mongodb/mongodb",
|
"name": "mongodb/mongodb",
|
||||||
"version": "2.3.0",
|
"version": "2.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mongodb/mongo-php-library",
|
"url": "https://github.com/mongodb/mongo-php-library.git",
|
||||||
"reference": "12e56461166d915e3dd8e4969ad0940ed5207d88"
|
"reference": "bbb13f969e37e047fd822527543df55fdc1c9298"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/12e56461166d915e3dd8e4969ad0940ed5207d88",
|
"url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/bbb13f969e37e047fd822527543df55fdc1c9298",
|
||||||
"reference": "12e56461166d915e3dd8e4969ad0940ed5207d88",
|
"reference": "bbb13f969e37e047fd822527543df55fdc1c9298",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"composer-runtime-api": "^2.0",
|
"composer-runtime-api": "^2.0",
|
||||||
"ext-mongodb": "^2.3",
|
"ext-mongodb": "^2.2",
|
||||||
"php": "^8.1",
|
"php": "^8.1",
|
||||||
"psr/log": "^1.1.4|^2|^3",
|
"psr/log": "^1.1.4|^2|^3",
|
||||||
"symfony/polyfill-php85": "^1.33"
|
"symfony/polyfill-php85": "^1.32"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"mongodb/builder": "*"
|
"mongodb/builder": "*"
|
||||||
@@ -4513,7 +4513,11 @@
|
|||||||
"mongodb",
|
"mongodb",
|
||||||
"persistence"
|
"persistence"
|
||||||
],
|
],
|
||||||
"time": "2026-04-28T12:50:06+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/mongodb/mongo-php-library/issues",
|
||||||
|
"source": "https://github.com/mongodb/mongo-php-library/tree/2.2.0"
|
||||||
|
},
|
||||||
|
"time": "2026-02-11T11:39:56+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "monolog/monolog",
|
"name": "monolog/monolog",
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('sofa_score_player_positions', function (Blueprint $table) {
|
||||||
|
$table->string('ss_code')->index();
|
||||||
|
$table->string('name');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('sofa_score_player_positions');
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,142 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class SofaScorePlayerPositionSeeder extends Seeder
|
||||||
|
{
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* SofaScore Player Positions
|
||||||
|
*/
|
||||||
|
$sql = "INSERT INTO `sofa_score_player_positions` (`ss_code`, `name`)
|
||||||
|
VALUES
|
||||||
|
('AM', 'Attacking Midfield'),
|
||||||
|
('DC', 'Centre-Back'),
|
||||||
|
('DL', 'Left-Back'),
|
||||||
|
('DM', 'Defensive Midfield'),
|
||||||
|
('DR', 'Right-Back'),
|
||||||
|
('GK', 'Goalkeeper'),
|
||||||
|
('LW', 'Left Winger'),
|
||||||
|
('MC', 'Central Midfield'),
|
||||||
|
('ML', 'Left Midfield'),
|
||||||
|
('MR', 'Right Midfield'),
|
||||||
|
('RW', 'Right Winger'),
|
||||||
|
('ST', 'Centre-Forward'),
|
||||||
|
('DC_AM', 'Centre-Back, Attacking Midfield'),
|
||||||
|
('DL_AM', 'Left-Back, Attacking Midfield'),
|
||||||
|
('DM_AM', 'Defensive Midfield, Attacking Midfield'),
|
||||||
|
('DR_AM', 'Right-Back, Attacking Midfield'),
|
||||||
|
('LW_AM', 'Left Winger, Attacking Midfield'),
|
||||||
|
('MC_AM', 'Central Midfield, Attacking Midfield'),
|
||||||
|
('ML_AM', 'Left Midfield, Attacking Midfield'),
|
||||||
|
('MR_AM', 'Right Midfield, Attacking Midfield'),
|
||||||
|
('RW_AM', 'Right Winger, Attacking Midfield'),
|
||||||
|
('ST_AM', 'Centre-Forward, Attacking Midfield'),
|
||||||
|
('AM_DC', 'Attacking Midfield, Centre-Back'),
|
||||||
|
('DL_DC', 'Left-Back, Centre-Back'),
|
||||||
|
('DM_DC', 'Defensive Midfield, Centre-Back'),
|
||||||
|
('DR_DC', 'Right-Back, Centre-Back'),
|
||||||
|
('LW_DC', 'Left Winger, Centre-Back'),
|
||||||
|
('MC_DC', 'Central Midfield, Centre-Back'),
|
||||||
|
('ML_DC', 'Left Midfield, Centre-Back'),
|
||||||
|
('MR_DC', 'Right Midfield, Centre-Back'),
|
||||||
|
('RW_DC', 'Right Winger, Centre-Back'),
|
||||||
|
('ST_DC', 'Centre-Forward, Centre-Back'),
|
||||||
|
('AM_DL', 'Attacking Midfield, Left-Back'),
|
||||||
|
('DC_DL', 'Centre-Back, Left-Back'),
|
||||||
|
('DM_DL', 'Defensive Midfield, Left-Back'),
|
||||||
|
('DR_DL', 'Right-Back, Left-Back'),
|
||||||
|
('LW_DL', 'Left Winger, Left-Back'),
|
||||||
|
('MC_DL', 'Central Midfield, Left-Back'),
|
||||||
|
('ML_DL', 'Left Midfield, Left-Back'),
|
||||||
|
('MR_DL', 'Right Midfield, Left-Back'),
|
||||||
|
('RW_DL', 'Right Winger, Left-Back'),
|
||||||
|
('ST_DL', 'Centre-Forward, Left-Back'),
|
||||||
|
('AM_DM', 'Attacking Midfield, Defensive Midfield'),
|
||||||
|
('DC_DM', 'Centre-Back, Defensive Midfield'),
|
||||||
|
('DL_DM', 'Left-Back, Defensive Midfield'),
|
||||||
|
('DR_DM', 'Right-Back, Defensive Midfield'),
|
||||||
|
('LW_DM', 'Left Winger, Defensive Midfield'),
|
||||||
|
('MC_DM', 'Central Midfield, Defensive Midfield'),
|
||||||
|
('ML_DM', 'Left Midfield, Defensive Midfield'),
|
||||||
|
('MR_DM', 'Right Midfield, Defensive Midfield'),
|
||||||
|
('RW_DM', 'Right Winger, Defensive Midfield'),
|
||||||
|
('ST_DM', 'Centre-Forward, Defensive Midfield'),
|
||||||
|
('AM_DR', 'Attacking Midfield, Right-Back'),
|
||||||
|
('DC_DR', 'Centre-Back, Right-Back'),
|
||||||
|
('DL_DR', 'Left-Back, Right-Back'),
|
||||||
|
('DM_DR', 'Defensive Midfield, Right-Back'),
|
||||||
|
('LW_DR', 'Left Winger, Right-Back'),
|
||||||
|
('MC_DR', 'Central Midfield, Right-Back'),
|
||||||
|
('ML_DR', 'Left Midfield, Right-Back'),
|
||||||
|
('MR_DR', 'Right Midfield, Right-Back'),
|
||||||
|
('RW_DR', 'Right Winger, Right-Back'),
|
||||||
|
('ST_DR', 'Centre-Forward, Right-Back'),
|
||||||
|
('AM_LW', 'Attacking Midfield, Left Winger'),
|
||||||
|
('DC_LW', 'Centre-Back, Left Winger'),
|
||||||
|
('DL_LW', 'Left-Back, Left Winger'),
|
||||||
|
('DM_LW', 'Defensive Midfield, Left Winger'),
|
||||||
|
('DR_LW', 'Right-Back, Left Winger'),
|
||||||
|
('MC_LW', 'Central Midfield, Left Winger'),
|
||||||
|
('ML_LW', 'Left Midfield, Left Winger'),
|
||||||
|
('MR_LW', 'Right Midfield, Left Winger'),
|
||||||
|
('RW_LW', 'Right Winger, Left Winger'),
|
||||||
|
('ST_LW', 'Centre-Forward, Left Winger'),
|
||||||
|
('AM_MC', 'Attacking Midfield, Central Midfield'),
|
||||||
|
('DC_MC', 'Centre-Back, Central Midfield'),
|
||||||
|
('DL_MC', 'Left-Back, Central Midfield'),
|
||||||
|
('DM_MC', 'Defensive Midfield, Central Midfield'),
|
||||||
|
('DR_MC', 'Right-Back, Central Midfield'),
|
||||||
|
('LW_MC', 'Left Winger, Central Midfield'),
|
||||||
|
('ML_MC', 'Left Midfield, Central Midfield'),
|
||||||
|
('MR_MC', 'Right Midfield, Central Midfield'),
|
||||||
|
('RW_MC', 'Right Winger, Central Midfield'),
|
||||||
|
('ST_MC', 'Centre-Forward, Central Midfield'),
|
||||||
|
('AM_ML', 'Attacking Midfield, Left Midfield'),
|
||||||
|
('DC_ML', 'Centre-Back, Left Midfield'),
|
||||||
|
('DL_ML', 'Left-Back, Left Midfield'),
|
||||||
|
('DM_ML', 'Defensive Midfield, Left Midfield'),
|
||||||
|
('DR_ML', 'Right-Back, Left Midfield'),
|
||||||
|
('LW_ML', 'Left Winger, Left Midfield'),
|
||||||
|
('MC_ML', 'Central Midfield, Left Midfield'),
|
||||||
|
('MR_ML', 'Right Midfield, Left Midfield'),
|
||||||
|
('RW_ML', 'Right Winger, Left Midfield'),
|
||||||
|
('ST_ML', 'Centre-Forward, Left Midfield'),
|
||||||
|
('AM_MR', 'Attacking Midfield, Right Midfield'),
|
||||||
|
('DC_MR', 'Centre-Back, Right Midfield'),
|
||||||
|
('DL_MR', 'Left-Back, Right Midfield'),
|
||||||
|
('DM_MR', 'Defensive Midfield, Right Midfield'),
|
||||||
|
('DR_MR', 'Right-Back, Right Midfield'),
|
||||||
|
('LW_MR', 'Left Winger, Right Midfield'),
|
||||||
|
('MC_MR', 'Central Midfield, Right Midfield'),
|
||||||
|
('ML_MR', 'Left Midfield, Right Midfield'),
|
||||||
|
('RW_MR', 'Right Winger, Right Midfield'),
|
||||||
|
('ST_MR', 'Centre-Forward, Right Midfield'),
|
||||||
|
('AM_RW', 'Attacking Midfield, Right Winger'),
|
||||||
|
('DC_RW', 'Centre-Back, Right Winger'),
|
||||||
|
('DL_RW', 'Left-Back, Right Winger'),
|
||||||
|
('DM_RW', 'Defensive Midfield, Right Winger'),
|
||||||
|
('DR_RW', 'Right-Back, Right Winger'),
|
||||||
|
('LW_RW', 'Left Winger, Right Winger'),
|
||||||
|
('MC_RW', 'Central Midfield, Right Winger'),
|
||||||
|
('ML_RW', 'Left Midfield, Right Winger'),
|
||||||
|
('MR_RW', 'Right Midfield, Right Winger'),
|
||||||
|
('ST_RW', 'Centre-Forward, Right Winger'),
|
||||||
|
('AM_ST', 'Attacking Midfield, Centre-Forward'),
|
||||||
|
('DC_ST', 'Centre-Back, Centre-Forward'),
|
||||||
|
('DL_ST', 'Left-Back, Centre-Forward'),
|
||||||
|
('DM_ST', 'Defensive Midfield, Centre-Forward'),
|
||||||
|
('DR_ST', 'Right-Back, Centre-Forward'),
|
||||||
|
('LW_ST', 'Left Winger, Centre-Forward'),
|
||||||
|
('MC_ST', 'Central Midfield, Centre-Forward'),
|
||||||
|
('ML_ST', 'Left Midfield, Centre-Forward'),
|
||||||
|
('MR_ST', 'Right Midfield, Centre-Forward'),
|
||||||
|
('RW_ST', 'Right Winger, Centre-Forward');
|
||||||
|
";
|
||||||
|
DB::unprepared($sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,123 @@
|
|||||||
|
CODE, NAME
|
||||||
|
AM, Attacking Midfield
|
||||||
|
DC, Centre-Back
|
||||||
|
DL, Left-Back
|
||||||
|
DM, Defensive Midfield
|
||||||
|
DR, Right-Back
|
||||||
|
GK, Goalkeeper
|
||||||
|
LW, Left Winger
|
||||||
|
MC, Central Midfield
|
||||||
|
ML, Left Midfield
|
||||||
|
MR, Right Midfield
|
||||||
|
RW, Right Winger
|
||||||
|
ST, Centre-Forward
|
||||||
|
DC_AM, Centre-Back_Attacking Midfield
|
||||||
|
DL_AM, Left-Back_Attacking Midfield
|
||||||
|
DM_AM, Defensive Midfield_Attacking Midfield
|
||||||
|
DR_AM, Right-Back_Attacking Midfield
|
||||||
|
LW_AM, Left Winger_Attacking Midfield
|
||||||
|
MC_AM, Central Midfield_Attacking Midfield
|
||||||
|
ML_AM, Left Midfield_Attacking Midfield
|
||||||
|
MR_AM, Right Midfield_Attacking Midfield
|
||||||
|
RW_AM, Right Winger_Attacking Midfield
|
||||||
|
ST_AM, Centre-Forward_Attacking Midfield
|
||||||
|
AM_DC, Attacking Midfield_Centre-Back
|
||||||
|
DL_DC, Left-Back_Centre-Back
|
||||||
|
DM_DC, Defensive Midfield_Centre-Back
|
||||||
|
DR_DC, Right-Back_Centre-Back
|
||||||
|
LW_DC, Left Winger_Centre-Back
|
||||||
|
MC_DC, Central Midfield_Centre-Back
|
||||||
|
ML_DC, Left Midfield_Centre-Back
|
||||||
|
MR_DC, Right Midfield_Centre-Back
|
||||||
|
RW_DC, Right Winger_Centre-Back
|
||||||
|
ST_DC, Centre-Forward_Centre-Back
|
||||||
|
AM_DL, Attacking Midfield_Left-Back
|
||||||
|
DC_DL, Centre-Back_Left-Back
|
||||||
|
DM_DL, Defensive Midfield_Left-Back
|
||||||
|
DR_DL, Right-Back_Left-Back
|
||||||
|
LW_DL, Left Winger_Left-Back
|
||||||
|
MC_DL, Central Midfield_Left-Back
|
||||||
|
ML_DL, Left Midfield_Left-Back
|
||||||
|
MR_DL, Right Midfield_Left-Back
|
||||||
|
RW_DL, Right Winger_Left-Back
|
||||||
|
ST_DL, Centre-Forward_Left-Back
|
||||||
|
AM_DM, Attacking Midfield_Defensive Midfield
|
||||||
|
DC_DM, Centre-Back_Defensive Midfield
|
||||||
|
DL_DM, Left-Back_Defensive Midfield
|
||||||
|
DR_DM, Right-Back_Defensive Midfield
|
||||||
|
LW_DM, Left Winger_Defensive Midfield
|
||||||
|
MC_DM, Central Midfield_Defensive Midfield
|
||||||
|
ML_DM, Left Midfield_Defensive Midfield
|
||||||
|
MR_DM, Right Midfield_Defensive Midfield
|
||||||
|
RW_DM, Right Winger_Defensive Midfield
|
||||||
|
ST_DM, Centre-Forward_Defensive Midfield
|
||||||
|
AM_DR, Attacking Midfield_Right-Back
|
||||||
|
DC_DR, Centre-Back_Right-Back
|
||||||
|
DL_DR, Left-Back_Right-Back
|
||||||
|
DM_DR, Defensive Midfield_Right-Back
|
||||||
|
LW_DR, Left Winger_Right-Back
|
||||||
|
MC_DR, Central Midfield_Right-Back
|
||||||
|
ML_DR, Left Midfield_Right-Back
|
||||||
|
MR_DR, Right Midfield_Right-Back
|
||||||
|
RW_DR, Right Winger_Right-Back
|
||||||
|
ST_DR, Centre-Forward_Right-Back
|
||||||
|
AM_LW, Attacking Midfield_Left Winger
|
||||||
|
DC_LW, Centre-Back_Left Winger
|
||||||
|
DL_LW, Left-Back_Left Winger
|
||||||
|
DM_LW, Defensive Midfield_Left Winger
|
||||||
|
DR_LW, Right-Back_Left Winger
|
||||||
|
MC_LW, Central Midfield_Left Winger
|
||||||
|
ML_LW, Left Midfield_Left Winger
|
||||||
|
MR_LW, Right Midfield_Left Winger
|
||||||
|
RW_LW, Right Winger_Left Winger
|
||||||
|
ST_LW, Centre-Forward_Left Winger
|
||||||
|
AM_MC, Attacking Midfield_Central Midfield
|
||||||
|
DC_MC, Centre-Back_Central Midfield
|
||||||
|
DL_MC, Left-Back_Central Midfield
|
||||||
|
DM_MC, Defensive Midfield_Central Midfield
|
||||||
|
DR_MC, Right-Back_Central Midfield
|
||||||
|
LW_MC, Left Winger_Central Midfield
|
||||||
|
ML_MC, Left Midfield_Central Midfield
|
||||||
|
MR_MC, Right Midfield_Central Midfield
|
||||||
|
RW_MC, Right Winger_Central Midfield
|
||||||
|
ST_MC, Centre-Forward_Central Midfield
|
||||||
|
AM_ML, Attacking Midfield_Left Midfield
|
||||||
|
DC_ML, Centre-Back_Left Midfield
|
||||||
|
DL_ML, Left-Back_Left Midfield
|
||||||
|
DM_ML, Defensive Midfield_Left Midfield
|
||||||
|
DR_ML, Right-Back_Left Midfield
|
||||||
|
LW_ML, Left Winger_Left Midfield
|
||||||
|
MC_ML, Central Midfield_Left Midfield
|
||||||
|
MR_ML, Right Midfield_Left Midfield
|
||||||
|
RW_ML, Right Winger_Left Midfield
|
||||||
|
ST_ML, Centre-Forward_Left Midfield
|
||||||
|
AM_MR, Attacking Midfield_Right Midfield
|
||||||
|
DC_MR, Centre-Back_Right Midfield
|
||||||
|
DL_MR, Left-Back_Right Midfield
|
||||||
|
DM_MR, Defensive Midfield_Right Midfield
|
||||||
|
DR_MR, Right-Back_Right Midfield
|
||||||
|
LW_MR, Left Winger_Right Midfield
|
||||||
|
MC_MR, Central Midfield_Right Midfield
|
||||||
|
ML_MR, Left Midfield_Right Midfield
|
||||||
|
RW_MR, Right Winger_Right Midfield
|
||||||
|
ST_MR, Centre-Forward_Right Midfield
|
||||||
|
AM_RW, Attacking Midfield_Right Winger
|
||||||
|
DC_RW, Centre-Back_Right Winger
|
||||||
|
DL_RW, Left-Back_Right Winger
|
||||||
|
DM_RW, Defensive Midfield_Right Winger
|
||||||
|
DR_RW, Right-Back_Right Winger
|
||||||
|
LW_RW, Left Winger_Right Winger
|
||||||
|
MC_RW, Central Midfield_Right Winger
|
||||||
|
ML_RW, Left Midfield_Right Winger
|
||||||
|
MR_RW, Right Midfield_Right Winger
|
||||||
|
ST_RW, Centre-Forward_Right Winger
|
||||||
|
AM_ST, Attacking Midfield_Centre-Forward
|
||||||
|
DC_ST, Centre-Back_Centre-Forward
|
||||||
|
DL_ST, Left-Back_Centre-Forward
|
||||||
|
DM_ST, Defensive Midfield_Centre-Forward
|
||||||
|
DR_ST, Right-Back_Centre-Forward
|
||||||
|
LW_ST, Left Winger_Centre-Forward
|
||||||
|
MC_ST, Central Midfield_Centre-Forward
|
||||||
|
ML_ST, Left Midfield_Centre-Forward
|
||||||
|
MR_ST, Right Midfield_Centre-Forward
|
||||||
|
RW_ST, Right Winger_Centre-Forward
|
||||||
Reference in new issue
Block a user