diff --git a/DAMON.md b/DAMON.md index 9b4a0dbb..2a4bbb9c 100644 --- a/DAMON.md +++ b/DAMON.md @@ -6,7 +6,7 @@ com.sofascore.grapper ProgramArguments - /Users/hermanntelser/Sites/nuhodds_fi4/setup.sh 13 + /Users/hermanntelser/Sites/nuhodds_fi4/apple_damon.sh StartCalendarInterval diff --git a/app/Console/Commands/Grapper/Sofascore.php b/app/Console/Commands/Grapper/Sofascore.php index 46b29fe0..6755e80a 100644 --- a/app/Console/Commands/Grapper/Sofascore.php +++ b/app/Console/Commands/Grapper/Sofascore.php @@ -7,10 +7,6 @@ use App\Console\Commands\Grapper\Sofascore\EventsDatabase; use App\Console\Commands\Grapper\Sofascore\Special; use App\Console\Commands\Grapper\Sofascore\Tournament; use App\Console\Commands\Nuh; -use App\Models\SofaScoreCategorie; -use App\Models\SofaScoreDay; -use App\Models\SofaScoreDayTournament; -use App\Models\SofaScoreTournament; use App\Utilities\Notice; use DateTime; use Illuminate\Support\Carbon; @@ -29,14 +25,6 @@ class Sofascore { $debug = Nuh::$options['d'] ?? 0; - if (Nuh::$options['truncate']) { - SofaScoreDayTournament::truncate(); - SofaScoreTournament::truncate(); - SofaScoreDay::truncate(); - SofaScoreCategorie::truncate(); - Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1); - } - if (Nuh::$options['t']) { self::$_days[] = Carbon::now()->format('Y-m-d'); } elseif (Nuh::$options['day']) { diff --git a/app/Console/Commands/Grapper/Sofascore/EventsDatabase.php b/app/Console/Commands/Grapper/Sofascore/EventsDatabase.php index 4bfe1dc4..f1554207 100644 --- a/app/Console/Commands/Grapper/Sofascore/EventsDatabase.php +++ b/app/Console/Commands/Grapper/Sofascore/EventsDatabase.php @@ -2,7 +2,6 @@ namespace App\Console\Commands\Grapper\Sofascore; -use App\Console\Commands\Grapper\Sofascore\Tools\LoadDays; use App\Console\Commands\Grapper\Sofascore\Tools\LoadTournaments; use App\Console\Commands\Nuh; use App\Utilities\Notice; @@ -12,7 +11,7 @@ class EventsDatabase { public static $storage_path = '/Console/Commands/Grapper/Sofascore/grapped/'; - public static function load() + public static function load($days) { $debug = Nuh::$options['d'] ?? 0; @@ -20,8 +19,6 @@ class EventsDatabase $langsam = Nuh::$options['l'] ?? 0; - $days = LoadDays::load(); - $tornaments = LoadTournaments::load(); if ($print) { diff --git a/app/Console/Commands/Grapper/Sofascore/Specials/CreateZip.php b/app/Console/Commands/Grapper/Sofascore/Specials/CreateZip.php index 07b63cff..480cbf5a 100644 --- a/app/Console/Commands/Grapper/Sofascore/Specials/CreateZip.php +++ b/app/Console/Commands/Grapper/Sofascore/Specials/CreateZip.php @@ -2,17 +2,14 @@ namespace App\Console\Commands\Grapper\Sofascore\Specials; -use App\Console\Commands\Grapper\Sofascore\Tools\LoadDays; use App\Utilities\Notice; use App\Utilities\ZipFolder; class CreateZip { - public static function run() + public static function run($days) { - $days = LoadDays::load(); - foreach ($days as $day) { ZipFolder::create($day); } diff --git a/app/Console/Commands/Grapper/Sofascore/Specials/SendMail.php b/app/Console/Commands/Grapper/Sofascore/Specials/SendMail.php index 3e1694c0..7342f8c1 100644 --- a/app/Console/Commands/Grapper/Sofascore/Specials/SendMail.php +++ b/app/Console/Commands/Grapper/Sofascore/Specials/SendMail.php @@ -3,16 +3,13 @@ namespace App\Console\Commands\Grapper\Sofascore\Specials; use App\Console\Commands\Grapper\Sofascore\Special; -use App\Console\Commands\Grapper\Sofascore\Tools\LoadDays; use App\Utilities\Notice; use Illuminate\Support\Facades\Mail; class SendMail { - public static function run() + public static function run($days) { - $days = LoadDays::load(); - foreach ($days as $day) { $zip_file = Special::$storage_path.'/'.$day.'.zip'; diff --git a/app/Console/Commands/Grapper/Sofascore/Tournament.php b/app/Console/Commands/Grapper/Sofascore/Tournament.php index 4a585b61..97f33a0f 100644 --- a/app/Console/Commands/Grapper/Sofascore/Tournament.php +++ b/app/Console/Commands/Grapper/Sofascore/Tournament.php @@ -5,7 +5,6 @@ namespace App\Console\Commands\Grapper\Sofascore; use App\Console\Commands\Nuh; use App\Models\Country; use App\Models\SofaScoreCategorie; -use App\Models\SofaScoreDay; use App\Models\SofaScoreDayTournament; use App\Models\SofaScoreTournament; use App\Models\Sport; @@ -49,10 +48,12 @@ class Tournament $tournaments_counter = 0; + Notice::note('needs day fixing', 'br', 1); + /** * grap only one time/sport check */ - if ($force || ! SofaScoreDay::where('day', $day)->where($sport->ss_slug, 1)->first()) { + if ($force) { if ($debug) { Notice::note('Grapping Sport: ' . Nuh::$options['sport'] . ' Day: ' . $day, 'p'); @@ -181,7 +182,6 @@ class Tournament Notice::note("tournaments: $tournaments_counter", 'p'); } - SofaScoreDay::updateOrCreate(['day' => $day], ['sport_id' => $sport->id]); } } else { if ($debug) { diff --git a/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/Pages/CreateSofaScoreDay.php b/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/Pages/CreateSofaScoreDay.php deleted file mode 100644 index 8919de53..00000000 --- a/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/Pages/CreateSofaScoreDay.php +++ /dev/null @@ -1,11 +0,0 @@ -components([ - // - ]); - } -} diff --git a/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/SofaScoreDayResource.php b/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/SofaScoreDayResource.php deleted file mode 100644 index f242ca5d..00000000 --- a/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/SofaScoreDayResource.php +++ /dev/null @@ -1,48 +0,0 @@ -count(); - } - - public static function getPages(): array - { - return [ - 'index' => ListSofaScoreDays::route('/'), - ]; - } -} diff --git a/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/Tables/SofaScoreDaysTable.php b/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/Tables/SofaScoreDaysTable.php deleted file mode 100644 index 8c215967..00000000 --- a/app/Filament/Clusters/Grapper/Resources/SofaScoreDays/Tables/SofaScoreDaysTable.php +++ /dev/null @@ -1,156 +0,0 @@ -description('For days checked events active in tournaments will be grapped.') - ->headerActions([ - Action::make('generate')->icon('phosphor-calendar') - ->schema([ - Select::make('sport_id') - ->options(Sport::where('is_active', 1) - ->pluck('name', 'id')) - ->required(), - Select::make('year') - ->options(self::years()) - ->required(), - Select::make('month') - ->options(self::month()) - ->required(), - ]) - ->action(function (array $data, $table): void { - $sport_id = $data['sport_id']; - $date = Carbon::createFromDate($data['year'], $data['month'], 1)->startOfMonth(); - $daysCount = $date->daysInMonth; - - $allDates = []; - for ($i = 1; $i <= $daysCount; $i++) { - $allDates[] = $date->copy()->day($i)->format('Y-m-d'); - } - foreach ($allDates as $day) { - SofaScoreDay::updateOrCreate(['day' => $day, 'sport_id' => $sport_id]); - } - }), - Action::make('reset') - ->icon('phosphor-power') - ->schema([ - Select::make('sport_id') - ->options(Sport::where('is_active', 1) - ->pluck('name', 'id')) - ->required(), - ]) - ->action(function (array $data): void { - $sport_id = $data['sport_id']; - SofaScoreDay::where('sport_id', $sport_id)->update(['enabled' => 0]); - }), - ]) - ->columns([ - TextColumn::make('sport.name'), - TextColumn::make('day')->sortable(), - ToggleColumn::make('enabled'), - ]) - ->filters([ - Filter::make('filter') - ->columns(4)->columnSpan(4) - ->schema([ - Select::make('sport_id') - ->default(1) - ->selectablePlaceholder(false) - ->label('Sport') - ->options(Sport::where('is_active', 1)->pluck('name', 'id')), - Select::make('year')->options(self::years()), - Select::make('month')->options(self::month()), - Toggle::make('enabled'), - ]) - ->query(function (Builder $query, array $data): Builder { - return $query->when( - $data['year'], - fn (Builder $query, $year): Builder => $query->whereYear('day', $year), - )->when( - $data['month'], - fn (Builder $query, $month): Builder => $query->whereMonth('day', $month), - )->when( - $data['enabled'], - fn (Builder $query, $enabled): Builder => $query->where('enabled', $enabled), - ); - })->indicateUsing(function (array $data): array { - $indicators = []; - if ($data['year'] ?? null) { - $indicators[] = Indicator::make('Year: '.$data['year']); - } - if ($data['month'] ?? null) { - $indicators[] = Indicator::make('Month: '.$data['month']); - } - - return $indicators; - }), - ], layout: FiltersLayout::AboveContent) - ->persistFiltersInSession() - ->deferFilters(false) - ->toolbarActions([ - BulkActionGroup::make([ - BulkAction::make('Enable') - ->icon('phosphor-toggle-right-fill') - ->color('primary') - ->action(function (Collection $records): void { - foreach ($records as $record) { - SofaScoreDay::where('id', '=', $record->id) - ->update( - ['enabled' => 1] - ); - } - }), - BulkAction::make('Disable') - ->icon('phosphor-toggle-left-fill') - ->color('gray') - ->action(function (Collection $records): void { - foreach ($records as $record) { - SofaScoreDay::where('id', '=', $record->id) - ->update( - ['enabled' => 0] - ); - } - }), - ])->label('Grapping Day'), - ]); - } - - public static function years() - { - $years = range(date('Y'), date('Y') - 10); - - return array_combine($years, $years); - } - - public static function month() - { - $months = []; - for ($m = 1; $m <= 12; $m++) { - $date = Carbon::create(null, $m, 1); - $months[$date->format('m')] = $date->format('F'); - } - - return $months; - } -} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/EditSofaScoreTask.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/EditSofaScoreTask.php index 4c40662e..a237747e 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/EditSofaScoreTask.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/EditSofaScoreTask.php @@ -2,9 +2,11 @@ namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\Pages; +use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\RelationManagers\SofaScoreTaskTournamentsRelationManager; use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\SofaScoreTaskResource; use Filament\Actions\DeleteAction; use Filament\Resources\Pages\EditRecord; +use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction; class EditSofaScoreTask extends EditRecord { diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/ListSofaScoreTasks.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/ListSofaScoreTasks.php index 8c5f08a1..a0d376a2 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/ListSofaScoreTasks.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Pages/ListSofaScoreTasks.php @@ -2,9 +2,11 @@ namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\Pages; +use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\RelationManagers\SofaScoreTaskTournamentsRelationManager; use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\SofaScoreTaskResource; use Filament\Actions\CreateAction; use Filament\Resources\Pages\ListRecords; +use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction; class ListSofaScoreTasks extends ListRecords { diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/RelationManagers/SofaScoreTaskTournamentsRelationManager.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/RelationManagers/SofaScoreTaskTournamentsRelationManager.php new file mode 100644 index 00000000..a1e79d76 --- /dev/null +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/RelationManagers/SofaScoreTaskTournamentsRelationManager.php @@ -0,0 +1,89 @@ +components([ + Select::make('sofa_score_categorie_id') + ->searchable() + ->label('Categorie') + ->options(function (Get $get) { + $res = SofaScoreTournament::where('sport_id', $this->getOwnerRecord()['sport_id']) + ->groupBy('sofa_score_categorie_id') + ->pluck('sofa_score_categorie_id') + ->toArray(); + return SofaScoreCategorie::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id'); + }) + ->live(), + Select::make('sofa_score_tournament_id') + ->searchable() + ->label('Tournament') + ->options(fn (Get $get) => SofaScoreTournament::where('sport_id', $this->getOwnerRecord()['sport_id']) + ->where('disabled', 0) + ->where('sofa_score_categorie_id', $get('sofa_score_categorie_id')) + ->pluck('name', 'tournament_id')), + ]); + } + + public function table(Table $table): Table + { + return $table + ->columns([ + TextColumn::make('tournament.sofascore_category.name') + ->label('Country') + ->searchable(), + TextColumn::make('tournament.name') + ->weight(FontWeight::Bold) + ->searchable(), + ToggleColumn::make('disabled') + ->alignCenter(), + ]) + ->filters([ + // + ]) + ->headerActions([ + CreateAction::make() + ->icon('phosphor-plus') + ->label('Tournament'), + ]) + ->recordActions([ + EditAction::make(), + DeleteAction::make(), + ]) + ->toolbarActions([ + BulkActionGroup::make([ + DeleteBulkAction::make(), + ]), + ]); + } +} diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php index 84a25d0b..b9e72678 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Schemas/SofaScoreTaskForm.php @@ -31,9 +31,11 @@ class SofaScoreTaskForm 'range' => 'Grap a date range', ]), DatePicker::make('day_from') + ->required() ->native() ->visible(fn (Get $get): bool => in_array($get('mode'), ['date', 'range'])), DatePicker::make('day_to') + ->required() ->native() ->visible(fn (Get $get): bool => $get('mode') === 'range'), ]); diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php index 64aeb285..b63efb2b 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/SofaScoreTaskResource.php @@ -22,9 +22,9 @@ class SofaScoreTaskResource extends Resource protected static ?string $modelLabel = 'SofaScore Tasks'; - protected static ?int $navigationSort = 0; + protected static ?int $navigationSort = 1; - protected static string|UnitEnum|null $navigationGroup = 'Statistiko'; + protected static string|UnitEnum|null $navigationGroup = 'SofaScore'; public static function form(Schema $schema): Schema { @@ -36,13 +36,6 @@ class SofaScoreTaskResource extends Resource return SofaScoreTasksTable::configure($table); } - public static function getRelations(): array - { - return [ - // - ]; - } - public static function getNavigationBadge(): ?string { return parent::getEloquentQuery()->count(); diff --git a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php index 121de300..a1514dff 100644 --- a/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTasks/Tables/SofaScoreTasksTable.php @@ -2,11 +2,16 @@ namespace App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\Tables; +use App\Filament\Clusters\StaticData\Resources\SofaScoreTasks\RelationManagers\SofaScoreTaskTournamentsRelationManager; +use App\Models\SofaScoreTask; +use Filament\Actions\DeleteAction; use Filament\Actions\EditAction; +use Filament\Schemas\Components\Utilities\Set; use Filament\Tables\Columns\IconColumn; use Filament\Tables\Columns\TextColumn; use Filament\Tables\Columns\ToggleColumn; use Filament\Tables\Table; +use Guava\FilamentModalRelationManagers\Actions\RelationManagerAction; class SofaScoreTasksTable { @@ -20,29 +25,46 @@ class SofaScoreTasksTable ->width(30) ->icon(fn ($record) => $record->sport->icon), TextColumn::make('sport.name'), + IconColumn::make('compleated') + ->width('1rem') + ->label('Status') + ->alignCenter() + ->icon(fn (string $state): string => match ($state) { + '0' => 'phosphor-pause-fill', + '1' => 'phosphor-check-fat-fill', + }) + ->color(fn (string $state): string => match ($state) { + '0' => 'gray', + '1' => 'success', + }), TextColumn::make('mode') ->label('Grapping dates') - ->badge() - ->color(fn ($state): string => match ($state) { - 'yesterday' => 'warning', - 'date' => 'primary', - 'range' => 'success', - }) ->formatStateUsing(fn (string $state, $record): string => match ($state) { 'yesterday' => 'Every yesterday', - 'date' => $record->day_from->format('Y-m-d'), - 'range' => $record->day_from.' - '.$record->day_to, + 'date' => $record->day_from, + 'range' => $record->day_from.' <=> '.$record->day_to, + }), + ToggleColumn::make('is_active') + ->alignCenter() + ->afterStateUpdated(function ($record) { + SofaScoreTask::where('id', $record->id)->update(['compleated' => 0]); }), - ToggleColumn::make('is_active')->alignCenter(), ToggleColumn::make('run_slow')->alignCenter(), ToggleColumn::make('run_repeatedly')->alignCenter(), - ToggleColumn::make('compleated')->alignCenter(), ]) ->filters([ // ]) ->recordActions([ - EditAction::make(), + RelationManagerAction::make() + ->icon('phosphor-trophy-fill') + ->iconButton() + ->modalHeading('Add tournaments to sofascore grapper task') + ->relationManager(SofaScoreTaskTournamentsRelationManager::make()) + ->compact(), + EditAction::make()->iconButton() + ->icon('phosphor-calendar-fill'), + DeleteAction::make()->iconButton(), ]); } } diff --git a/app/Filament/Clusters/Grapper/Resources/SofaScoreTournaments/Pages/CreateSofaScoreTournament.php b/app/Filament/Clusters/StaticData/Resources/SofaScoreTournaments/Pages/CreateSofaScoreTournament.php similarity index 50% rename from app/Filament/Clusters/Grapper/Resources/SofaScoreTournaments/Pages/CreateSofaScoreTournament.php rename to app/Filament/Clusters/StaticData/Resources/SofaScoreTournaments/Pages/CreateSofaScoreTournament.php index 3f90f4c4..c4bba76c 100644 --- a/app/Filament/Clusters/Grapper/Resources/SofaScoreTournaments/Pages/CreateSofaScoreTournament.php +++ b/app/Filament/Clusters/StaticData/Resources/SofaScoreTournaments/Pages/CreateSofaScoreTournament.php @@ -1,8 +1,8 @@ headerActions([ - Action::make('grapping') - ->icon('phosphor-power') - ->tooltip('Will stop grapping for selected sport') - ->schema([ - Select::make('sport') - ->options(Sport::where('is_active', 1) - ->pluck('name', 'id')) - ->required(), - ]) - ->action(function (array $data): void { - $sport_id = $data['sport_id']; - SofaScoreTournament::where('sport_id', $sport_id)->update(['enabled' => 0]); - }), - Action::make('disabled') - ->icon('phosphor-power') - ->tooltip('Will activate all disabled leagues for selected sport') - ->schema([ - Select::make('sport') - ->options(Sport::where('is_active', 1) - ->pluck('name', 'id')) - ->required(), - ]) - ->action(function (array $data): void { - $sport_id = $data['sport_id']; - SofaScoreTournament::where('sport_id', $sport_id)->update(['disabled' => 0]); - }), - ]) - ->poll() ->columns([ IconColumn::make('sport.icon') ->label('') @@ -73,7 +41,7 @@ class SofaScoreTournamentsTable TextColumn::make('sofascore_category.name') ->icon(fn ($record) => $record->sofascore_category->country->icon), TextColumn::make('name')->searchable()->sortable(), - ToggleColumn::make('enabled')->label('Enable'), + // ToggleColumn::make('enabled')->label('Enable'), ToggleColumn::make('disabled')->label('Disable'), ]) ->filters([ @@ -103,15 +71,15 @@ class SofaScoreTournamentsTable return SofaScoreCategorie::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id'); }) ->live(), - ToggleButtons::make('filter-grapping') - ->inline() - ->columnSpan(2) - ->default('active') - ->options([ - 'all' => 'All', - 'active' => 'Active', - 'disabled' => 'Disabled', - ]), + // ToggleButtons::make('filter-grapping') + // ->inline() + // ->columnSpan(2) + // ->default('active') + // ->options([ + // 'all' => 'All', + // 'active' => 'Active', + // 'disabled' => 'Disabled', + // ]), ToggleButtons::make('filter-disabled') ->inline() ->columnSpan(2) diff --git a/app/Models/SofaScoreTask.php b/app/Models/SofaScoreTask.php index ac70e3f6..799a612d 100644 --- a/app/Models/SofaScoreTask.php +++ b/app/Models/SofaScoreTask.php @@ -24,4 +24,9 @@ class SofaScoreTask extends Model { return $this->belongsTo(Sport::class); } + + public function sofa_score_task_tournaments() + { + return $this->hasMany(SofaScoreTaskTournament::class); + } } diff --git a/app/Models/SofaScoreTaskTournament.php b/app/Models/SofaScoreTaskTournament.php new file mode 100644 index 00000000..c2cc1086 --- /dev/null +++ b/app/Models/SofaScoreTaskTournament.php @@ -0,0 +1,24 @@ +belongsTo(SofaScoreTask::class); + } + + public function tournament() + { + return $this->belongsTo(SofaScoreTournament::class, 'sofa_score_tournament_id', 'tournament_id'); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 521a7feb..ad62efdb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -72,6 +72,9 @@ class AppServiceProvider extends ServiceProvider 'info' => Color::Blue, 'success' => Color::Green, 'warning' => Color::Amber, + 'sky' => Color::Sky, + 'yellow' => Color::Yellow, + 'teal' => Color::Teal, ]); } } diff --git a/apple_damon.sh b/apple_damon.sh new file mode 100755 index 00000000..d21a6c9f --- /dev/null +++ b/apple_damon.sh @@ -0,0 +1,24 @@ +# AUTO GRAPPER SOFASCORE + +echo "\n⚽ close all open vpn" +killall ssh + +# echo "\n⚽ open vpn tunnel to prod" +# ssh -f -N -L 13306:127.0.0.1:3306 -p 58371 root@162.55.242.190 + +# echo "\n⚽ copy active tournaments" +# php artisan nuh --d --f 73 --prc=2 + +# echo "\n⚽ close tunnel" +# killall ssh + +# echo "\n⚽ grapp data sofascore" +# php artisan nuh --d --f --y 72 + +# echo "\n⚽ create zip archive" +# php artisan nuh --d --f --y 73 --prc=3 + +# echo "\n⚽ mail archive" +# php artisan nuh --d --f --y 73 --prc=4 + +# echo "\n😎 done :)" \ No newline at end of file diff --git a/composer.json b/composer.json index 5720b908..82a9b66c 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "codeat3/blade-phosphor-icons": "*", "codewithkyrian/filament-date-range": "^2.2", "filament/filament": "^5.3", - "guava/filament-modal-relation-managers": "^3.0", + "guava/filament-modal-relation-managers": "^3.1", "joaopaulolndev/filament-edit-profile": "^3.0", "laravel/framework": "*", "laravel/tinker": "*", diff --git a/composer.lock b/composer.lock index 6f3429ce..f0da666d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f2008484d55fed9d274d3f2ad273d65f", + "content-hash": "dea2c9fda74951c05718378dc9b3c9fe", "packages": [ { "name": "agencetwogether/hookshelper", @@ -4457,24 +4457,24 @@ }, { "name": "mongodb/mongodb", - "version": "2.3.0", + "version": "2.2.0", "source": { "type": "git", - "url": "https://github.com/mongodb/mongo-php-library", - "reference": "12e56461166d915e3dd8e4969ad0940ed5207d88" + "url": "https://github.com/mongodb/mongo-php-library.git", + "reference": "bbb13f969e37e047fd822527543df55fdc1c9298" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/12e56461166d915e3dd8e4969ad0940ed5207d88", - "reference": "12e56461166d915e3dd8e4969ad0940ed5207d88", + "url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/bbb13f969e37e047fd822527543df55fdc1c9298", + "reference": "bbb13f969e37e047fd822527543df55fdc1c9298", "shasum": "" }, "require": { "composer-runtime-api": "^2.0", - "ext-mongodb": "^2.3", + "ext-mongodb": "^2.2", "php": "^8.1", "psr/log": "^1.1.4|^2|^3", - "symfony/polyfill-php85": "^1.33" + "symfony/polyfill-php85": "^1.32" }, "replace": { "mongodb/builder": "*" @@ -4526,7 +4526,11 @@ "mongodb", "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", @@ -8023,90 +8027,6 @@ ], "time": "2026-04-10T16:19:22+00:00" }, - { - "name": "symfony/polyfill-iconv", - "version": "v1.37.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "2c5729fd241b4b22f6e4b436bc3354a4f262df57" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/2c5729fd241b4b22f6e4b436bc3354a4f262df57", - "reference": "2c5729fd241b4b22f6e4b436bc3354a4f262df57", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "provide": { - "ext-iconv": "*" - }, - "suggest": { - "ext-iconv": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Iconv\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Iconv extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "iconv", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-iconv/tree/v1.37.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2026-04-10T16:19:22+00:00" - }, { "name": "symfony/polyfill-intl-grapheme", "version": "v1.38.1", diff --git a/database/migrations/2026_06_06_134919_create_sofa_score_days_table.php b/database/migrations/2026_07_01_062952_create_sofa_score_task_tournaments_table.php similarity index 50% rename from database/migrations/2026_06_06_134919_create_sofa_score_days_table.php rename to database/migrations/2026_07_01_062952_create_sofa_score_task_tournaments_table.php index 21fc36e3..ad8c3448 100644 --- a/database/migrations/2026_06_06_134919_create_sofa_score_days_table.php +++ b/database/migrations/2026_07_01_062952_create_sofa_score_task_tournaments_table.php @@ -11,11 +11,11 @@ return new class extends Migration */ public function up(): void { - Schema::create('sofa_score_days', function (Blueprint $table) { + Schema::create('sofa_score_task_tournaments', function (Blueprint $table) { $table->id(); - $table->date('day')->index(); - $table->integer('sport_id')->index()->references('id')->on('sports'); - $table->boolean('enabled')->index()->default(0); + $table->integer('sofa_score_task_id')->index()->references('id')->on('sofa_score_tasks'); + $table->integer('sofa_score_tournament_id')->index()->references('id')->on('sofa_score_tournaments'); + $table->boolean('disabled')->default(0); $table->timestamps(); }); } @@ -25,6 +25,6 @@ return new class extends Migration */ public function down(): void { - Schema::dropIfExists('sofa_score_days'); + Schema::dropIfExists('sofa_score_task_tournaments'); } };