diff --git a/app/Console/Commands/Grapper/Sofascore/Grapper.php b/app/Console/Commands/Grapper/Sofascore/Grapper.php index 943694ce..90ea80f5 100644 --- a/app/Console/Commands/Grapper/Sofascore/Grapper.php +++ b/app/Console/Commands/Grapper/Sofascore/Grapper.php @@ -8,16 +8,29 @@ use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays; use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper; use App\Console\Commands\Nuh; use App\Models\SofaScoreDayTournament; +use App\Models\SofaScoreEventGrapped; use App\Models\SofaScoreTaskTournament; use App\Utilities\Notice; +use Illuminate\Support\Carbon; use Illuminate\Support\Facades\File; class Grapper { public static function load() { + /** + * yesterday + * + * nuh --d --f 67 --fun=6 --task=1 + * + * 1783710000 + * 10 July 2026 09:00:00 PM CEST + */ + $debug = Nuh::$options['d'] ?? 0; + $force = Nuh::$options['f'] ?? 0; + $task_id = Nuh::$options['task'] ?? 0; $days = LoadDays::load(); @@ -49,7 +62,7 @@ class Grapper $data = CurlSofa::load($url); - dd($data); + // dd($data); Nuh::$options['s'] = 0; @@ -59,88 +72,102 @@ class Grapper foreach ($data['events'] as $event) { - dd($event); + $now = Carbon::now()->subHours(4); + $starttime = Carbon::createFromTimestamp($event->startTimestamp); - // "hasEventPlayerStatistics" => true + if ($now->greaterThan($starttime)) { - $folder = Sofascore::$grapper_path . $day . '/' . $event['tournament']['slug'] . '/' . $event['slug']; + $event_grapped = SofaScoreEventGrapped::where('id', $event['id'])->first(); + $event_grapped['name'] = $event->homeTeam['name'] . ' vs ' . $event->awayTeam['name']; + $event_grapped['url'] = $url; - File::makeDirectory($folder, 0775, true, true); + $folder = Sofascore::$grapper_path . $day . '/' . $event['tournament']['slug'] . '/' . $event['slug']; - /********************************* - * EVENT event - *********************************/ + File::makeDirectory($folder, 0775, true, true); - File::put($folder . '/event.json', json_encode($event)); + /********************************* + * EVENT event + *********************************/ - /********************************* - * EVENT statistics - *********************************/ + File::put($folder . '/event.json', json_encode($event)); - $event_id = $event['id']; + /********************************* + * EVENT statistics + *********************************/ - if (!File::exists($folder . '/statistics.json')) { + $event_id = $event['id']; - $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics"; + if ($force || !$event_grapped['got_statistics'] && $event->hasEventPlayerStatistics) { - Sleeper::rand(); + $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics"; - $data = CurlSofa::load($url); + Sleeper::rand(); - $data['id'] = $event_id; + $data = CurlSofa::load($url); - File::put($folder . '/statistics.json', json_encode($data)); - } + $data['id'] = $event_id; - /********************************* - * EVENT lineups - *********************************/ + File::put($folder . '/statistics.json', json_encode($data)); - if (!File::exists($folder . '/lineups.json')) { + $event_grapped['got_statistics'] = 1; + } - $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups"; + /********************************* + * EVENT lineups + *********************************/ - Sleeper::rand(); + if ($force || !$event_grapped['got_lineups']) { - $data = CurlSofa::load($url); + $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups"; - $data['id'] = $event_id; + Sleeper::rand(); - File::put($folder . '/lineups.json', json_encode($data)); - } + $data = CurlSofa::load($url); - /********************************* - * EVENT odds - *********************************/ + $data['id'] = $event_id; - if (!File::exists($folder . '/odds.json')) { + File::put($folder . '/lineups.json', json_encode($data)); - $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all"; + $event_grapped['got_lineups'] = 1; + } - Sleeper::rand(); + /********************************* + * EVENT odds + *********************************/ - $data = CurlSofa::load($url); + if ($force || !$event_grapped['got_odds']) { - $data['id'] = $event_id; + $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all"; - File::put($folder . '/odds.json', json_encode($data)); - } + Sleeper::rand(); - /********************************* - * EVENT incidents - *********************************/ + $data = CurlSofa::load($url); - if (!File::exists($folder . '/incidents.json')) { + $data['id'] = $event_id; - $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents"; + File::put($folder . '/odds.json', json_encode($data)); - Sleeper::rand(); + $event_grapped['got_odds'] = 1; + } - $data = CurlSofa::load($url); + /********************************* + * EVENT incidents + *********************************/ - $data['id'] = $event_id; + if ($force || !$event_grapped['got_incidents']) { - File::put($folder . '/incidents.json', json_encode($data)); + $url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents"; + + Sleeper::rand(); + + $data = CurlSofa::load($url); + + $data['id'] = $event_id; + + File::put($folder . '/incidents.json', json_encode($data)); + + $event_grapped['got_incidents'] = 1; + } } } } diff --git a/app/Models/SofaScoreEventGrapped.php b/app/Models/SofaScoreEventGrapped.php index f2bd473d..cdbfaa5e 100644 --- a/app/Models/SofaScoreEventGrapped.php +++ b/app/Models/SofaScoreEventGrapped.php @@ -7,8 +7,13 @@ use Illuminate\Database\Eloquent\Model; class SofaScoreEventGrapped extends Model { protected $fillable = [ - 'event_id', + 'id', 'name', + 'url', 'starttime', + 'got_statistics', + 'got_lineups', + 'got_odds', + 'got_incidents', ]; } diff --git a/app/Policies/SofaScoreTaskPolicy.php b/app/Policies/SofaScoreTaskPolicy.php index 4f7dc3b1..4d6ad538 100644 --- a/app/Policies/SofaScoreTaskPolicy.php +++ b/app/Policies/SofaScoreTaskPolicy.php @@ -2,65 +2,65 @@ namespace App\Policies; -use App\Models\SofaScoreTask; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; class SofaScoreTaskPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:SofaScoreTask'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, SofaScoreTask $sofaScoreTask): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:SofaScoreTask'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:SofaScoreTask'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, SofaScoreTask $sofaScoreTask): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:SofaScoreTask'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, SofaScoreTask $sofaScoreTask): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:SofaScoreTask'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, SofaScoreTask $sofaScoreTask): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:SofaScoreTask'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, SofaScoreTask $sofaScoreTask): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:SofaScoreTask'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:SofaScoreTask'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:SofaScoreTask'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:SofaScoreTask'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:SofaScoreTask'); } } diff --git a/app/Policies/SofaScoreTournamentPolicy.php b/app/Policies/SofaScoreTournamentPolicy.php index c06c06fc..2e766bdd 100644 --- a/app/Policies/SofaScoreTournamentPolicy.php +++ b/app/Policies/SofaScoreTournamentPolicy.php @@ -2,65 +2,65 @@ namespace App\Policies; -use App\Models\SofaScoreTournament; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; class SofaScoreTournamentPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:SofaScoreTournament'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, SofaScoreTournament $sofaScoreTournament): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:SofaScoreTournament'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:SofaScoreTournament'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, SofaScoreTournament $sofaScoreTournament): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:SofaScoreTournament'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, SofaScoreTournament $sofaScoreTournament): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:SofaScoreTournament'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, SofaScoreTournament $sofaScoreTournament): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:SofaScoreTournament'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, SofaScoreTournament $sofaScoreTournament): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:SofaScoreTournament'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:SofaScoreTournament'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:SofaScoreTournament'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:SofaScoreTournament'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:SofaScoreTournament'); } } diff --git a/app/Policies/StatisticFixturesPolicy.php b/app/Policies/StatisticFixturesPolicy.php index a4139479..5ec75005 100644 --- a/app/Policies/StatisticFixturesPolicy.php +++ b/app/Policies/StatisticFixturesPolicy.php @@ -2,65 +2,66 @@ namespace App\Policies; -use App\Models\StatisticFixtures; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; + class StatisticFixturesPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:StatisticFixtures'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, StatisticFixtures $statisticFixtures): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:StatisticFixtures'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:StatisticFixtures'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, StatisticFixtures $statisticFixtures): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:StatisticFixtures'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, StatisticFixtures $statisticFixtures): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:StatisticFixtures'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, StatisticFixtures $statisticFixtures): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:StatisticFixtures'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, StatisticFixtures $statisticFixtures): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:StatisticFixtures'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:StatisticFixtures'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:StatisticFixtures'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:StatisticFixtures'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:StatisticFixtures'); } } diff --git a/app/Policies/StatistikoDetailPolicy.php b/app/Policies/StatistikoDetailPolicy.php index 2c322fb3..1794537a 100644 --- a/app/Policies/StatistikoDetailPolicy.php +++ b/app/Policies/StatistikoDetailPolicy.php @@ -2,65 +2,66 @@ namespace App\Policies; -use App\Models\StatistikoDetail; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; + class StatistikoDetailPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:StatistikoDetail'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, StatistikoDetail $statistikoDetail): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:StatistikoDetail'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:StatistikoDetail'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, StatistikoDetail $statistikoDetail): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:StatistikoDetail'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, StatistikoDetail $statistikoDetail): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:StatistikoDetail'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, StatistikoDetail $statistikoDetail): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:StatistikoDetail'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, StatistikoDetail $statistikoDetail): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:StatistikoDetail'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:StatistikoDetail'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:StatistikoDetail'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:StatistikoDetail'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:StatistikoDetail'); } } diff --git a/app/Policies/StatistikoEventPolicy.php b/app/Policies/StatistikoEventPolicy.php index bbdf992d..b9293c2f 100644 --- a/app/Policies/StatistikoEventPolicy.php +++ b/app/Policies/StatistikoEventPolicy.php @@ -2,65 +2,66 @@ namespace App\Policies; -use App\Models\StatistikoEvent; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; + class StatistikoEventPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:StatistikoEvent'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, StatistikoEvent $statistikoEvent): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:StatistikoEvent'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:StatistikoEvent'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, StatistikoEvent $statistikoEvent): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:StatistikoEvent'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, StatistikoEvent $statistikoEvent): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:StatistikoEvent'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, StatistikoEvent $statistikoEvent): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:StatistikoEvent'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, StatistikoEvent $statistikoEvent): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:StatistikoEvent'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:StatistikoEvent'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:StatistikoEvent'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:StatistikoEvent'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:StatistikoEvent'); } } diff --git a/app/Policies/StatistikoImportPolicy.php b/app/Policies/StatistikoImportPolicy.php index 78080d87..f0b7030f 100644 --- a/app/Policies/StatistikoImportPolicy.php +++ b/app/Policies/StatistikoImportPolicy.php @@ -2,65 +2,66 @@ namespace App\Policies; -use App\Models\StatistikoImport; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; + class StatistikoImportPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:StatistikoImport'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, StatistikoImport $statistikoImport): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:StatistikoImport'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:StatistikoImport'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, StatistikoImport $statistikoImport): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:StatistikoImport'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, StatistikoImport $statistikoImport): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:StatistikoImport'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, StatistikoImport $statistikoImport): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:StatistikoImport'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, StatistikoImport $statistikoImport): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:StatistikoImport'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:StatistikoImport'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:StatistikoImport'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:StatistikoImport'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:StatistikoImport'); } } diff --git a/app/Policies/StatistikoPlayerPolicy.php b/app/Policies/StatistikoPlayerPolicy.php index 3b0b8cc2..c282f619 100644 --- a/app/Policies/StatistikoPlayerPolicy.php +++ b/app/Policies/StatistikoPlayerPolicy.php @@ -2,65 +2,66 @@ namespace App\Policies; -use App\Models\StatistikoPlayer; -use App\Models\User; -use Illuminate\Auth\Access\Response; +use Illuminate\Auth\Access\HandlesAuthorization; +use Illuminate\Foundation\Auth\User as AuthUser; + class StatistikoPlayerPolicy { - /** - * Determine whether the user can view any models. - */ - public function viewAny(User $user): bool + use HandlesAuthorization; + + public function viewAny(AuthUser $authUser): bool { - return false; + return $authUser->can('ViewAny:StatistikoPlayer'); } - /** - * Determine whether the user can view the model. - */ - public function view(User $user, StatistikoPlayer $statistikoPlayer): bool + public function view(AuthUser $authUser): bool { - return false; + return $authUser->can('View:StatistikoPlayer'); } - /** - * Determine whether the user can create models. - */ - public function create(User $user): bool + public function create(AuthUser $authUser): bool { - return false; + return $authUser->can('Create:StatistikoPlayer'); } - /** - * Determine whether the user can update the model. - */ - public function update(User $user, StatistikoPlayer $statistikoPlayer): bool + public function update(AuthUser $authUser): bool { - return false; + return $authUser->can('Update:StatistikoPlayer'); } - /** - * Determine whether the user can delete the model. - */ - public function delete(User $user, StatistikoPlayer $statistikoPlayer): bool + public function delete(AuthUser $authUser): bool { - return false; + return $authUser->can('Delete:StatistikoPlayer'); } - /** - * Determine whether the user can restore the model. - */ - public function restore(User $user, StatistikoPlayer $statistikoPlayer): bool + public function restore(AuthUser $authUser): bool { - return false; + return $authUser->can('Restore:StatistikoPlayer'); } - /** - * Determine whether the user can permanently delete the model. - */ - public function forceDelete(User $user, StatistikoPlayer $statistikoPlayer): bool + public function forceDelete(AuthUser $authUser): bool { - return false; + return $authUser->can('ForceDelete:StatistikoPlayer'); + } + + public function forceDeleteAny(AuthUser $authUser): bool + { + return $authUser->can('ForceDeleteAny:StatistikoPlayer'); + } + + public function restoreAny(AuthUser $authUser): bool + { + return $authUser->can('RestoreAny:StatistikoPlayer'); + } + + public function replicate(AuthUser $authUser): bool + { + return $authUser->can('Replicate:StatistikoPlayer'); + } + + public function reorder(AuthUser $authUser): bool + { + return $authUser->can('Reorder:StatistikoPlayer'); } } diff --git a/database/migrations/2026_07_11_145940_create_sofa_score_event_grappeds_table.php b/database/migrations/2026_07_11_145940_create_sofa_score_event_grappeds_table.php index ad13af1c..ae0326e3 100644 --- a/database/migrations/2026_07_11_145940_create_sofa_score_event_grappeds_table.php +++ b/database/migrations/2026_07_11_145940_create_sofa_score_event_grappeds_table.php @@ -13,9 +13,13 @@ return new class extends Migration { Schema::create('sofa_score_event_grappeds', function (Blueprint $table) { $table->id(); - $table->integer('event_id'); - $table->string('name'); + $table->string('name')->nullable(); + $table->string('url')->nullable(); $table->dateTime('starttime')->nullable(); + $table->boolean('got_statistics')->default(false); + $table->boolean('got_lineups')->default(false); + $table->boolean('got_odds')->default(false); + $table->boolean('got_incidents')->default(false); $table->timestamps(); }); }