fix import types

This commit is contained in:
salam committed 2026-04-29 09:56:43 +02:00
1 parent 4bce04cd64
commit d30eb76442
6 files changed
+103 -103

No files matched your search

@@ -17,15 +17,15 @@ class StatistikoImportForm
Select::make('sport_id')
->required()
->label('Sport')
->options(Sport::where('is_active', 1)->pluck('name', 'id')),
->options(fn () => Sport::query()->where('is_active', 1)->pluck('name', 'id')),
Select::make('data_type')
->required()
->allowHtml()
->options([
'player' => '<span class="text-blue-500">Personal petail player</span>',
'personal' => '<span class="text-blue-500">Personal detail player</span>',
'events' => '<span class="text-green-500">Events</span>',
'fixtures' => '<span class="text-orange-500">Fixtures</span>',
'events_player' => '<span class="text-pink-600">Player</span>',
'player' => '<span class="text-pink-600">Player</span>',
]),
FileUpload::make('file_name')
@@ -32,10 +32,10 @@ class StatistikoImportsTable
->width('2rem')
->allowOptionsHtml()
->options([
'player' => '<span class="text-blue-500">Personal detail</span>',
'personal' => '<span class="text-blue-500">Personal details</span>',
'events' => '<span class="text-green-500">Events</span>',
'fixtures' => '<span class="text-orange-500">Fixtures</span>',
'events_player' => '<span class="text-amber-500">Player</span>',
'player' => '<span class="text-amber-500">Player</span>',
]),
TextColumn::make('file_name_original')
->searchable()
@@ -51,10 +51,10 @@ class StatistikoImportsTable
->filters([
SelectFilter::make('data_type')
->options([
'player' => 'Personal detail',
'personal' => 'Personal details',
'events' => 'Events',
'fixtures' => 'fixtures',
'events_player' => 'Player',
'player' => 'Player',
]),
])
->deferFilters(false)
+2 -2
View File
@@ -7,9 +7,9 @@ use Illuminate\Support\Carbon;
use Illuminate\Support\LazyCollection;
use Spatie\SimpleExcel\SimpleExcelReader;
class ImportPlayer
class ImportEvents
{
public static function importEvents(string $filePath, int $sport_id): void
public static function run(string $filePath, int $sport_id): void
{
$now = now()->format('Y-m-d H:i:s');
@@ -7,7 +7,7 @@ use Illuminate\Support\Carbon;
use Illuminate\Support\LazyCollection;
use Spatie\SimpleExcel\SimpleExcelReader;
class ImportPlayer
class ImportPersonal
{
public static function run(string $filePath): void
{
+5 -5
View File
@@ -5,7 +5,7 @@ namespace App\Filament\Imports;
use App\Filament\Imports\Helper\ImportBenchmark;
use App\Filament\Imports\Helper\ImportEvents;
use App\Filament\Imports\Helper\ImportFixtures;
use App\Filament\Imports\Helper\ImportPlayer;
use App\Filament\Imports\Helper\ImportPersonal;
use App\Models\StatistikoImport;
class StatistikoImporter
@@ -32,8 +32,8 @@ class StatistikoImporter
ImportBenchmark::start($table);
switch ($record['data_type']) {
case 'player':
ImportPlayer::run($filePath);
case 'personal':
ImportPersonal::run($filePath);
break;
case 'events':
ImportEvents::run($filePath, $sport_id);
@@ -41,11 +41,11 @@ class StatistikoImporter
case 'fixtures':
ImportFixtures::run($filePath, $sport_id);
break;
case 'events_player':
case 'player':
break;
}
StatistikoImport::where('id', $record->id)->update(['has_run' => 1]);
StatistikoImport::query()->where('id', $record->id)->update(['has_run' => 1]);
ImportBenchmark::end($table);
}
Generated
+88 -88
View File
@@ -396,16 +396,16 @@
},
{
"name": "blade-ui-kit/blade-icons",
"version": "1.9.1",
"version": "1.10.0",
"source": {
"type": "git",
"url": "https://github.com/driesvints/blade-icons.git",
"reference": "377eede719f9690b03bbbfd516afef887e27634a"
"reference": "74189a80bbaa4966aebaee54fec3a3c2ef0a5f3a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/driesvints/blade-icons/zipball/377eede719f9690b03bbbfd516afef887e27634a",
"reference": "377eede719f9690b03bbbfd516afef887e27634a",
"url": "https://api.github.com/repos/driesvints/blade-icons/zipball/74189a80bbaa4966aebaee54fec3a3c2ef0a5f3a",
"reference": "74189a80bbaa4966aebaee54fec3a3c2ef0a5f3a",
"shasum": ""
},
"require": {
@@ -473,7 +473,7 @@
"type": "paypal"
}
],
"time": "2026-04-07T17:56:48+00:00"
"time": "2026-04-23T19:03:45+00:00"
},
{
"name": "brick/math",
@@ -1438,16 +1438,16 @@
},
{
"name": "filament/actions",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/actions.git",
"reference": "0ab8251a829cfd800b4b463d57bbb126a212fa28"
"reference": "fe5b10e270021e428294cea8381e608780bb243b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filamentphp/actions/zipball/0ab8251a829cfd800b4b463d57bbb126a212fa28",
"reference": "0ab8251a829cfd800b4b463d57bbb126a212fa28",
"url": "https://api.github.com/repos/filamentphp/actions/zipball/fe5b10e270021e428294cea8381e608780bb243b",
"reference": "fe5b10e270021e428294cea8381e608780bb243b",
"shasum": ""
},
"require": {
@@ -1482,11 +1482,11 @@
"issues": "https://github.com/filamentphp/filament/issues",
"source": "https://github.com/filamentphp/filament"
},
"time": "2026-04-21T15:40:50+00:00"
"time": "2026-04-24T08:57:06+00:00"
},
{
"name": "filament/filament",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/panels.git",
@@ -1543,16 +1543,16 @@
},
{
"name": "filament/forms",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/forms.git",
"reference": "8ebc5bf00397e683243694bc6bd25163c511b9f0"
"reference": "73571a3ca19bee4c1974e8bb2ba3c022bd284bd6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filamentphp/forms/zipball/8ebc5bf00397e683243694bc6bd25163c511b9f0",
"reference": "8ebc5bf00397e683243694bc6bd25163c511b9f0",
"url": "https://api.github.com/repos/filamentphp/forms/zipball/73571a3ca19bee4c1974e8bb2ba3c022bd284bd6",
"reference": "73571a3ca19bee4c1974e8bb2ba3c022bd284bd6",
"shasum": ""
},
"require": {
@@ -1589,11 +1589,11 @@
"issues": "https://github.com/filamentphp/filament/issues",
"source": "https://github.com/filamentphp/filament"
},
"time": "2026-04-21T15:36:43+00:00"
"time": "2026-04-24T08:58:46+00:00"
},
{
"name": "filament/infolists",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/infolists.git",
@@ -1638,16 +1638,16 @@
},
{
"name": "filament/notifications",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/notifications.git",
"reference": "b6d6a349dab2177600dd981a5c94e7c1a52ea6dd"
"reference": "970765bd93b6d5aee2e110e67586f28e3199c0c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/filamentphp/notifications/zipball/b6d6a349dab2177600dd981a5c94e7c1a52ea6dd",
"reference": "b6d6a349dab2177600dd981a5c94e7c1a52ea6dd",
"url": "https://api.github.com/repos/filamentphp/notifications/zipball/970765bd93b6d5aee2e110e67586f28e3199c0c0",
"reference": "970765bd93b6d5aee2e110e67586f28e3199c0c0",
"shasum": ""
},
"require": {
@@ -1681,11 +1681,11 @@
"issues": "https://github.com/filamentphp/filament/issues",
"source": "https://github.com/filamentphp/filament"
},
"time": "2026-04-21T15:41:06+00:00"
"time": "2026-04-24T08:57:15+00:00"
},
{
"name": "filament/query-builder",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/query-builder.git",
@@ -1731,7 +1731,7 @@
},
{
"name": "filament/schemas",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/schemas.git",
@@ -1776,7 +1776,7 @@
},
{
"name": "filament/support",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/support.git",
@@ -1834,7 +1834,7 @@
},
{
"name": "filament/tables",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/tables.git",
@@ -1880,7 +1880,7 @@
},
{
"name": "filament/widgets",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/widgets.git",
@@ -3229,16 +3229,16 @@
},
{
"name": "laravel/serializable-closure",
"version": "v2.0.12",
"version": "v2.0.13",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "a6abb4e54f6fcd3138120b9ad497f0bd146f9919"
"reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/a6abb4e54f6fcd3138120b9ad497f0bd146f9919",
"reference": "a6abb4e54f6fcd3138120b9ad497f0bd146f9919",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/b566ee0dd251f3c4078bed003a7ce015f5ea6dce",
"reference": "b566ee0dd251f3c4078bed003a7ce015f5ea6dce",
"shasum": ""
},
"require": {
@@ -3286,7 +3286,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2026-04-14T13:33:34+00:00"
"time": "2026-04-16T14:03:50+00:00"
},
{
"name": "laravel/tinker",
@@ -6653,16 +6653,16 @@
},
{
"name": "spatie/shiki-php",
"version": "2.3.3",
"version": "2.4.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/shiki-php.git",
"reference": "9d50ff4d9825d87d3283a6695c65ae9c3c3caa6b"
"reference": "b8b0ca32d3a82bc5c533e68ffab96c5d4ec1b9ba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/shiki-php/zipball/9d50ff4d9825d87d3283a6695c65ae9c3c3caa6b",
"reference": "9d50ff4d9825d87d3283a6695c65ae9c3c3caa6b",
"url": "https://api.github.com/repos/spatie/shiki-php/zipball/b8b0ca32d3a82bc5c533e68ffab96c5d4ec1b9ba",
"reference": "b8b0ca32d3a82bc5c533e68ffab96c5d4ec1b9ba",
"shasum": ""
},
"require": {
@@ -6706,7 +6706,7 @@
"spatie"
],
"support": {
"source": "https://github.com/spatie/shiki-php/tree/2.3.3"
"source": "https://github.com/spatie/shiki-php/tree/2.4.0"
},
"funding": [
{
@@ -6714,7 +6714,7 @@
"type": "github"
}
],
"time": "2026-02-01T09:30:04+00:00"
"time": "2026-04-27T14:27:52+00:00"
},
{
"name": "spatie/simple-excel",
@@ -7994,7 +7994,7 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
@@ -8053,7 +8053,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0"
},
"funding": [
{
@@ -8077,16 +8077,16 @@
},
{
"name": "symfony/polyfill-intl-grapheme",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-grapheme.git",
"reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df"
"reference": "4864388bfbd3001ce88e234fab652acd91fdc57e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/ad1b7b9092976d6c948b8a187cec9faaea9ec1df",
"reference": "ad1b7b9092976d6c948b8a187cec9faaea9ec1df",
"url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/4864388bfbd3001ce88e234fab652acd91fdc57e",
"reference": "4864388bfbd3001ce88e234fab652acd91fdc57e",
"shasum": ""
},
"require": {
@@ -8135,7 +8135,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.37.0"
},
"funding": [
{
@@ -8155,11 +8155,11 @@
"type": "tidelift"
}
],
"time": "2026-04-10T16:19:22+00:00"
"time": "2026-04-26T13:13:48+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
@@ -8222,7 +8222,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.37.0"
},
"funding": [
{
@@ -8246,7 +8246,7 @@
},
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
@@ -8307,7 +8307,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.37.0"
},
"funding": [
{
@@ -8331,7 +8331,7 @@
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
@@ -8392,7 +8392,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.37.0"
},
"funding": [
{
@@ -8416,7 +8416,7 @@
},
{
"name": "symfony/polyfill-php80",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
@@ -8476,7 +8476,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0"
},
"funding": [
{
@@ -8500,7 +8500,7 @@
},
{
"name": "symfony/polyfill-php81",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php81.git",
@@ -8556,7 +8556,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php81/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-php81/tree/v1.37.0"
},
"funding": [
{
@@ -8580,7 +8580,7 @@
},
{
"name": "symfony/polyfill-php83",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php83.git",
@@ -8636,7 +8636,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php83/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-php83/tree/v1.37.0"
},
"funding": [
{
@@ -8660,16 +8660,16 @@
},
{
"name": "symfony/polyfill-php85",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php85.git",
"reference": "2c408a6bb0313e6001a83628dc5506100474254e"
"reference": "fcfa4973a9917cef23f2e38774da74a2b7d115ee"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/2c408a6bb0313e6001a83628dc5506100474254e",
"reference": "2c408a6bb0313e6001a83628dc5506100474254e",
"url": "https://api.github.com/repos/symfony/polyfill-php85/zipball/fcfa4973a9917cef23f2e38774da74a2b7d115ee",
"reference": "fcfa4973a9917cef23f2e38774da74a2b7d115ee",
"shasum": ""
},
"require": {
@@ -8716,7 +8716,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php85/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-php85/tree/v1.37.0"
},
"funding": [
{
@@ -8736,11 +8736,11 @@
"type": "tidelift"
}
],
"time": "2026-04-10T16:50:15+00:00"
"time": "2026-04-26T13:10:57+00:00"
},
{
"name": "symfony/polyfill-uuid",
"version": "v1.36.0",
"version": "v1.37.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-uuid.git",
@@ -8799,7 +8799,7 @@
"uuid"
],
"support": {
"source": "https://github.com/symfony/polyfill-uuid/tree/v1.36.0"
"source": "https://github.com/symfony/polyfill-uuid/tree/v1.37.0"
},
"funding": [
{
@@ -9706,16 +9706,16 @@
},
{
"name": "voku/portable-ascii",
"version": "2.1.0",
"version": "2.1.1",
"source": {
"type": "git",
"url": "https://github.com/voku/portable-ascii.git",
"reference": "d870a33f0f79d2b4579740b0620200221ee44aeb"
"reference": "8e1051fe39379367aecf014f41744ce7539a856f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/d870a33f0f79d2b4579740b0620200221ee44aeb",
"reference": "d870a33f0f79d2b4579740b0620200221ee44aeb",
"url": "https://api.github.com/repos/voku/portable-ascii/zipball/8e1051fe39379367aecf014f41744ce7539a856f",
"reference": "8e1051fe39379367aecf014f41744ce7539a856f",
"shasum": ""
},
"require": {
@@ -9752,7 +9752,7 @@
],
"support": {
"issues": "https://github.com/voku/portable-ascii/issues",
"source": "https://github.com/voku/portable-ascii/tree/2.1.0"
"source": "https://github.com/voku/portable-ascii/tree/2.1.1"
},
"funding": [
{
@@ -9776,22 +9776,22 @@
"type": "tidelift"
}
],
"time": "2026-04-16T23:10:39+00:00"
"time": "2026-04-26T05:33:54+00:00"
}
],
"packages-dev": [
{
"name": "barryvdh/laravel-debugbar",
"version": "v4.2.7",
"version": "v4.2.8",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
"reference": "e9863784b8ee42f7a4393bea90a0750f632df779"
"reference": "799d70c1101d3f8840dd76ff68ff6a78f9352905"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/e9863784b8ee42f7a4393bea90a0750f632df779",
"reference": "e9863784b8ee42f7a4393bea90a0750f632df779",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/799d70c1101d3f8840dd76ff68ff6a78f9352905",
"reference": "799d70c1101d3f8840dd76ff68ff6a78f9352905",
"shasum": ""
},
"require": {
@@ -9865,7 +9865,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.7"
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.2.8"
},
"funding": [
{
@@ -9877,7 +9877,7 @@
"type": "github"
}
],
"time": "2026-04-18T17:01:20+00:00"
"time": "2026-04-20T13:31:29+00:00"
},
{
"name": "brianium/paratest",
@@ -10146,7 +10146,7 @@
},
{
"name": "filament/upgrade",
"version": "v5.6.0",
"version": "v5.6.1",
"source": {
"type": "git",
"url": "https://github.com/filamentphp/upgrade.git",
@@ -10516,16 +10516,16 @@
},
{
"name": "laravel/sail",
"version": "v1.57.0",
"version": "v1.58.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "fa8d057b6e9310380ccbc3a209ed7f927d54f648"
"reference": "2e5e968138ca52ed87d712449697a8364d73b466"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/fa8d057b6e9310380ccbc3a209ed7f927d54f648",
"reference": "fa8d057b6e9310380ccbc3a209ed7f927d54f648",
"url": "https://api.github.com/repos/laravel/sail/zipball/2e5e968138ca52ed87d712449697a8364d73b466",
"reference": "2e5e968138ca52ed87d712449697a8364d73b466",
"shasum": ""
},
"require": {
@@ -10575,7 +10575,7 @@
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2026-04-14T13:32:04+00:00"
"time": "2026-04-27T13:38:34+00:00"
},
{
"name": "mockery/mockery",
@@ -11725,11 +11725,11 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.51",
"version": "2.1.53",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dc3b523c45e714c70de2ac5113b958223b55dc59",
"reference": "dc3b523c45e714c70de2ac5113b958223b55dc59",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/ef67586798c003274797b288a68b221e4270dca7",
"reference": "ef67586798c003274797b288a68b221e4270dca7",
"shasum": ""
},
"require": {
@@ -11774,7 +11774,7 @@
"type": "github"
}
],
"time": "2026-04-21T18:22:01+00:00"
"time": "2026-04-28T16:09:00+00:00"
},
{
"name": "phpunit/php-code-coverage",