This commit is contained in:
salam committed 2026-09-26 08:45:26 +02:00
1 parent d50df325ef
commit 267b5b9583
8 files changed
+237 -193

No files matched your search

+13 -10
View File
@@ -46,9 +46,10 @@ class Grap extends Command
$txt .= '--F force DayTournament links' . PHP_EOL; $txt .= '--F force DayTournament links' . PHP_EOL;
$txt .= '--c clear grap dir' . PHP_EOL; $txt .= '--c clear grap dir' . PHP_EOL;
$txt .= '--m mail only' . PHP_EOL; $txt .= '--m mail only' . PHP_EOL;
$txt .= '--g grap & excel only' . PHP_EOL; $txt .= '--C clear folder' . PHP_EOL;
$txt .= '--R read file' . PHP_EOL; $txt .= '--G grap' . PHP_EOL;
$txt .= '--S save to file' . PHP_EOL; $txt .= '--E make excel' . PHP_EOL;
$txt .= '--M mail' . PHP_EOL;
$txt .= '--folder' . PHP_EOL; $txt .= '--folder' . PHP_EOL;
$txt .= '-----------------------------------------------------------' . PHP_EOL; $txt .= '-----------------------------------------------------------' . PHP_EOL;
$txt .= 'FUNCTION' . PHP_EOL; $txt .= 'FUNCTION' . PHP_EOL;
@@ -69,18 +70,20 @@ class Grap extends Command
case 1: case 1:
// DAILY // DAILY
SetStorage::set(1);
RemoveDir::remove(); if (self::$options['C']) {
// with --m just resend mail
if (! self::$options['m']) {
Grapper::load(1); Grapper::load(1);
}
if (self::$options['G']) {
Grapper::load(1);
}
if (self::$options['E']) {
MakeExcel::create(); MakeExcel::create();
} }
// with --g just grap & excel if (self::$options['M']) {
if (! self::$options['g']) {
SendMail::run(1); SendMail::run(1);
} }
+112 -107
View File
@@ -13,7 +13,6 @@ use App\Models\SofaScoreTaskTournament;
use App\Utilities\Notice; use App\Utilities\Notice;
use Illuminate\Support\Carbon; use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Storage;
class Grapper class Grapper
{ {
@@ -44,16 +43,11 @@ class Grapper
default: default:
$active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', $task_id)->where('disabled', false)->get(); $active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_task_id', $task_id)->where('disabled', false)->get();
// $active_tournaments = SofaScoreTaskTournament::with('tournament')->where('sofa_score_tournament_id', 247)->where('sofa_score_task_id', $task_id)->where('disabled', false)->get();
break; break;
} }
/**
* daily restart always
*/
if (\in_array($task_id, [1, 2])) {
SofaScoreEventGrapped::where('grapper_id', $task_id)->delete();
}
/** /**
* Restart * Restart
*/ */
@@ -77,22 +71,33 @@ class Grapper
DaysTournament::get($day); DaysTournament::get($day);
dd($active_tournaments);
foreach ($active_tournaments as $tournament) { foreach ($active_tournaments as $tournament) {
$res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament->sofa_score_tournament_id)->first(); $res = SofaScoreDayTournament::whereDate('day', '=', $day)->where('tournament_id', $tournament->sofa_score_tournament_id)->first();
if ($res) { if ($res) {
// if ($debug) { if ($debug) {
// Notice::note($day, 'g'); Notice::note($tournament->sofa_score_tournament_id, 'bb');
// } }
if (! $force)
Sleeper::rand(1);
else
Sleeper::rand();
if ($debug) {
Notice::note($day, 'br');
}
$url = Grap::$options['base_url'] . "api/v1/unique-tournament/$tournament->sofa_score_tournament_id/scheduled-events/$day"; $url = Grap::$options['base_url'] . "api/v1/unique-tournament/$tournament->sofa_score_tournament_id/scheduled-events/$day";
Sleeper::rand(1);
$data = CurlSofa::load($url); $data = CurlSofa::load($url);
Notice::note($data, 'bb');
if (isset($data['events'])) { if (isset($data['events'])) {
if ($debug) { if ($debug) {
@@ -102,11 +107,8 @@ class Grapper
foreach ($data['events'] as $event) { foreach ($data['events'] as $event) {
Grap::$useragent = rand(1, 6); Grap::$useragent = rand(1, 6);
if (Storage::directoryExists(Grap::$storage . '/' . $day)) {
if ($debug) { if (! $force && SofaScoreEventGrapped::where('grapper_id', $task_id)->where('id', (int) $event['id'])->exists()) {
Notice::note('FOLDER - Allready grapped at ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g');
}
} else if (! $force && SofaScoreEventGrapped::where('id', (int) $event['id'])->exists()) {
if ($debug) { if ($debug) {
Notice::note('DB - Allready grapped at ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g'); Notice::note('DB - Allready grapped at ' . $day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'g');
} }
@@ -118,105 +120,103 @@ class Grapper
$starttime = Carbon::createFromTimestamp($event['startTimestamp']); $starttime = Carbon::createFromTimestamp($event['startTimestamp']);
if ($now->greaterThan($starttime) && $starttime->isSameDay($carbon_day)) { // dd($starttime);
// if ($now->greaterThan($starttime) && $starttime->isSameDay($carbon_day)) {
if (! $force)
Sleeper::rand(1); Sleeper::rand(1);
else
if ($debug) {
Notice::note($day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'bg');
}
$grapped = SofaScoreEventGrapped::firstOrNew(['id' => $event['id']]);
$grapped->grapper_id = $task_id;
$grapped->day = $day;
$grapped->liga = $event['tournament']['name'];
$grapped->name = $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'];
$grapped->url = $url;
$grapped->starttime = $starttime->toDateTimeString();
$folder = strtolower(Grap::$storage . '/' . $day . '/' . $day . '-' . $event['tournament']['category']['slug'] . '-' . $event['tournament']['slug'] . '/' . $event['slug']);
File::makeDirectory($folder, 0775, true, true);
/*********************************
* EVENT event
*********************************/
File::put($folder . '/event.json', json_encode($event));
/*********************************
* EVENT statistics
*********************************/
$event_id = $event['id'];
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/statistics";
Sleeper::rand(); Sleeper::rand();
$data = CurlSofa::load($url);
$data['id'] = $event_id; if ($debug) {
Notice::note($day . ' - ' . $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'], 'bg');
File::put($folder . '/statistics.json', json_encode($data));
$grapped->got_statistics = 1;
/*********************************
* EVENT lineups
*********************************/
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/lineups";
Sleeper::rand();
$data = CurlSofa::load($url);
$data['id'] = $event_id;
File::put($folder . '/lineups.json', json_encode($data));
$grapped->got_lineups = 1;
/*********************************
* EVENT odds
*********************************/
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
Sleeper::rand();
$data = CurlSofa::load($url);
$data['id'] = $event_id;
File::put($folder . '/odds.json', json_encode($data));
$grapped->got_odds = 1;
/*********************************
* EVENT incidents
*********************************/
$url = Grap::$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));
$grapped->got_incidents = 1;
$grapped->save();
} }
$folder = strtolower(Grap::$storage . '/' . $day . '/' . $day . '-' . $event['tournament']['category']['slug'] . '-' . $event['tournament']['slug'] . '/' . $event['slug']);
File::makeDirectory($folder, 0775, true, true);
/*********************************
* EVENT event
*********************************/
File::put($folder . '/event.json', json_encode($event));
/*********************************
* EVENT statistics
*********************************/
$event_id = $event['id'];
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/statistics";
Sleeper::rand();
$data = CurlSofa::load($url);
$data['id'] = $event_id;
File::put($folder . '/statistics.json', json_encode($data));
/*********************************
* EVENT lineups
*********************************/
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/lineups";
Sleeper::rand();
$data = CurlSofa::load($url);
$data['id'] = $event_id;
File::put($folder . '/lineups.json', json_encode($data));
/*********************************
* EVENT odds
*********************************/
$url = Grap::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
Sleeper::rand();
$data = CurlSofa::load($url);
$data['id'] = $event_id;
File::put($folder . '/odds.json', json_encode($data));
/*********************************
* EVENT incidents
*********************************/
$url = Grap::$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));
$grapped = SofaScoreEventGrapped::firstOrNew(['id' => $event['id']]);
$grapped->grapper_id = $task_id;
$grapped->day = $day;
$grapped->liga = $event['tournament']['name'];
$grapped->name = $event['homeTeam']['name'] . ' vs ' . $event['awayTeam']['name'];
$grapped->url = $url;
$grapped->starttime = $starttime->toDateTimeString();
$grapped->save();
// }
} }
} }
} }
} }
} }
SofaScoreTaskDay::updateOrCreate([ SofaScoreTaskDay::updateOrCreate([
'grapper_id' => (int) $task_id, 'grapper_id' => (int) $task_id,
'day' => $day, 'day' => $day,
@@ -227,8 +227,13 @@ class Grapper
$count++; $count++;
if ($debug) { if ($debug) {
Notice::note("$count days done", 'p'); Notice::note("$count days done, sleep 10-20 sec", 'p');
} }
if (! $force)
Sleeper::rand(2);
else
Sleeper::rand();
} }
} }
} }
@@ -4,6 +4,7 @@ namespace App\Console\Commands\Grapper\Sofascore;
use App\Console\Commands\Grap; use App\Console\Commands\Grap;
use App\Console\Commands\Grapper\Sofascore\Helper\CurlLivescore; use App\Console\Commands\Grapper\Sofascore\Helper\CurlLivescore;
use App\Console\Commands\Grapper\Sofascore\Helper\CurlSofa;
use App\Utilities\Notice; use App\Utilities\Notice;
use DOMDocument; use DOMDocument;
use DOMXPath; use DOMXPath;
@@ -19,17 +20,21 @@ class GrapperTest
$testfile = 'livescore.txt'; $testfile = 'livescore.txt';
$path = __DIR__.self::$testfiles.$testfile; $path = __DIR__ . self::$testfiles . $testfile;
Notice::note('Grapper testing '.$testfile, 'b'); Notice::note('Grapper testing ' . $testfile, 'b');
$url = 'https://www.livescore.in/horse-racing/canada/woodbine-2020/'; // $url = 'https://www.livescore.in/horse-racing/canada/woodbine-2020/';
$url = 'https://www.sofascore.com/api/v1/event/16298660/statistics';
$data = CurlSofa::load($url);
Notice::note($data, '', 1);
if ($read) { if ($read) {
Notice::note('data read localy', 'p'); Notice::note('data read localy', 'p');
$data = file_get_contents($path); $data = file_get_contents($path);
} else { } else {
$data = CurlLivescore::load($url); $data = CurlLivescore::load($url);
} }
@@ -58,7 +63,7 @@ class GrapperTest
$teams = $xpath->query("//div[contains(@class, 'event__participant')]"); $teams = $xpath->query("//div[contains(@class, 'event__participant')]");
foreach ($teams as $team) { foreach ($teams as $team) {
echo trim($team->nodeValue).PHP_EOL; echo trim($team->nodeValue) . PHP_EOL;
} }
Notice::note($data, 'p', 1); Notice::note($data, 'p', 1);
@@ -15,7 +15,13 @@ class CurlSofa
if ($debug) { if ($debug) {
Notice::note($url, 'b'); Notice::note($url, 'b');
} }
// $useragents = [];
// $useragents[1] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36";
// $useragents[2] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36";
// $useragents[3] = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3 Safari/605.1.15";
// $useragents[4] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0";
// $useragents[5] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36 Edg/133.0.0.0";
// $useragents[6] = "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Mobile Safari/537.36";
$useragents = []; $useragents = [];
$useragents[1] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15'; $useragents[1] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.2.1 Safari/605.1.15';
$useragents[2] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3.1 Safari/605.1.15'; $useragents[2] = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.3.1 Safari/605.1.15';
@@ -24,13 +30,31 @@ class CurlSofa
$useragents[5] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0'; $useragents[5] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0';
$useragents[6] = 'Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36'; $useragents[6] = 'Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36';
// GET /api/v1/config/default-unique-tournaments/AT/football HTTP/2
// Host: www.sofascore.com
// User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:139.0) Gecko/20100101 Firefox/139.0
// Accept: */*
// Accept-Language: de,en-US;q=0.7,en;q=0.3
// Accept-Encoding: gzip, deflate, br, zstd
// Referer: https://www.sofascore.com/
// X-Requested-With: 629800
// DNT: 1
// Sec-GPC: 1
// Connection: keep-alive
// Sec-Fetch-Dest: empty
// Sec-Fetch-Mode: cors
// Sec-Fetch-Site: same-origin
// Priority: u=4
// Pragma: no-cache
// Cache-Control: no-cache
// TE: trailers
$headers = [ $headers = [
'User-Agent: ' . $useragents[Grap::$useragent], 'User-Agent: ' . $useragents[Grap::$useragent],
'Accept: */*', 'Accept: */*',
'Accept-Language: de,en-US;q=0.7,en;q=0.3', 'Accept-Language: de,en-US;q=0.7,en;q=0.3',
'Accept-Encoding: gzip, deflate, br, zstd', 'Accept-Encoding: gzip, deflate, br, zstd',
'Referer: https://www.sofascore.com/', 'Referer: https://www.sofascore.com/',
'X-Requested-With: 5c6b10', 'X-Requested-With: 629800',
'DNT: 1', 'DNT: 1',
'Sec-GPC: 1', 'Sec-GPC: 1',
'Connection: keep-alive', 'Connection: keep-alive',
@@ -48,11 +72,10 @@ class CurlSofa
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// This line magically handles all decompression out-of-the-box:
curl_setopt($ch, CURLOPT_ENCODING, '');
$data = curl_exec($ch); $data = curl_exec($ch);
$data = gzdecode($data);
$data = json_decode($data, true); $data = json_decode($data, true);
return $data; return $data;
@@ -46,8 +46,8 @@ class LoadDays
default: default:
$from = ValidateDate::get($task->day_from); $from = ValidateDate::get($task->day_from);
$to = ValidateDate::get($task->day_to);
$from = Carbon::createFromDate($from); $from = Carbon::createFromDate($from);
$to = ValidateDate::get($task->day_to);
$to = Carbon::createFromDate($to); $to = Carbon::createFromDate($to);
break; break;
} }
+3 -3
View File
@@ -55,7 +55,7 @@ class PlayerProps extends Page implements HasForms
public ?array $filterData; public ?array $filterData;
public array $lineUpOptinos; public array $lineUpOptions;
public string $activeLineUp = '3313'; public string $activeLineUp = '3313';
@@ -167,7 +167,7 @@ class PlayerProps extends Page implements HasForms
->prefixIconColor('info') ->prefixIconColor('info')
->prefixIcon('icon-soccerfield-fill') ->prefixIcon('icon-soccerfield-fill')
->options(function () { ->options(function () {
$res = $this->lineUpOptinos(); $res = $this->lineUpOptions();
$arr = []; $arr = [];
foreach ($res as $key => $value) { foreach ($res as $key => $value) {
if ($this->players && in_array($key, $this->clientLineUps)) { if ($this->players && in_array($key, $this->clientLineUps)) {
@@ -219,7 +219,7 @@ class PlayerProps extends Page implements HasForms
return 5; return 5;
} }
private function lineUpOptinos(): array private function lineUpOptions(): array
{ {
return [ return [
'3313' => '3313', '3313' => '3313',
+53 -45
View File
@@ -19,15 +19,13 @@ use Filament\Forms\Components\Select;
use Filament\Forms\Components\Slider; use Filament\Forms\Components\Slider;
use Filament\Pages\Dashboard as BaseDashboard; use Filament\Pages\Dashboard as BaseDashboard;
use Filament\Pages\Dashboard\Concerns\HasFiltersForm; use Filament\Pages\Dashboard\Concerns\HasFiltersForm;
use Filament\Schemas\Components\Actions;
use Filament\Schemas\Components\Grid; use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Components\Utilities\Set; use Filament\Schemas\Components\Utilities\Set;
// use Filament\Support\Enums\SlideOverPosition;
// use Filament\Support\Enums\Width;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Support\RawJs; use Filament\Support\RawJs;
use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Contracts\View\View;
use Illuminate\Support\HtmlString; use Illuminate\Support\HtmlString;
class Statistic extends BaseDashboard class Statistic extends BaseDashboard
@@ -139,10 +137,10 @@ class Statistic extends BaseDashboard
->live() ->live()
->preload() ->preload()
->searchable(false) ->searchable(false)
->prefixIconColor(fn (Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
->prefixIcon('phosphor-globe-fill') ->prefixIcon('phosphor-globe-fill')
->hiddenLabel() ->hiddenLabel()
->options(fn () => LoadSofaScoreCategory::load()) ->options(fn() => LoadSofaScoreCategory::load())
->placeholder('Select Country') ->placeholder('Select Country')
->afterStateUpdated(function (callable $set, $state) { ->afterStateUpdated(function (callable $set, $state) {
$set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode')); $set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode'));
@@ -155,10 +153,10 @@ class Statistic extends BaseDashboard
Select::make('league_id') Select::make('league_id')
->live() ->live()
->preload() ->preload()
->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger')
->prefixIcon('phosphor-trophy-fill') ->prefixIcon('phosphor-trophy-fill')
->hiddenLabel() ->hiddenLabel()
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id'))) ->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
->placeholder('Select League') ->placeholder('Select League')
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('match_id', null); $set('match_id', null);
@@ -169,8 +167,8 @@ class Statistic extends BaseDashboard
Select::make('match_id') Select::make('match_id')
->live() ->live()
->hiddenLabel() ->hiddenLabel()
->columnSpan(fn (Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1) ->columnSpan(fn(Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger')
->prefixIcon('phosphor-calendar-check-fill') ->prefixIcon('phosphor-calendar-check-fill')
->options(function (Get $get) { ->options(function (Get $get) {
return LoadStatisticFixturesMatchOptions::load($get('league_id')); return LoadStatisticFixturesMatchOptions::load($get('league_id'));
@@ -183,10 +181,10 @@ class Statistic extends BaseDashboard
->placeholder('Select Event'), ->placeholder('Select Event'),
Action::make('esc') Action::make('esc')
->hiddenLabel() ->hiddenLabel()
->visible(fn (Get $get) => $get('similar_past_matches') != 'none') ->visible(fn(Get $get) => $get('similar_past_matches') != 'none')
->tooltip('Clear all (esc)') ->tooltip('Clear all (esc)')
->icon('phosphor-x-circle') ->icon('phosphor-x-circle')
->color('gray') ->color('warning')
->keyBindings(['esc']) ->keyBindings(['esc'])
->action('resetFilters'), ->action('resetFilters'),
@@ -203,7 +201,7 @@ class Statistic extends BaseDashboard
} }
}) })
->prefixIcon('phosphor-users-three-fill') ->prefixIcon('phosphor-users-three-fill')
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->options(function (Get $get) { ->options(function (Get $get) {
if ($get('match_id')) { if ($get('match_id')) {
$res = StatisticFixtures::where('id', $get('match_id'))->first(); $res = StatisticFixtures::where('id', $get('match_id'))->first();
@@ -232,9 +230,9 @@ class Statistic extends BaseDashboard
Action::make('iconInfo') Action::make('iconInfo')
->color('success') ->color('success')
->icon('phosphor-question-fill') ->icon('phosphor-question-fill')
->tooltip(fn () => 'Team Position') ->tooltip(fn() => 'Team Position')
) )
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->default('all') ->default('all')
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->options([ ->options([
@@ -289,20 +287,20 @@ class Statistic extends BaseDashboard
->live() ->live()
// ->columnSpan(2) // ->columnSpan(2)
->hiddenLabel() ->hiddenLabel()
->columnSpan(fn (Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1) ->columnSpan(fn(Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
->suffixAction(Action::make('reset') ->suffixAction(Action::make('reset')
->icon('phosphor-x-circle') ->icon('phosphor-x-circle')
->action(fn (callable $set) => $set('similar_past_matches', 'none')) ->action(fn(callable $set) => $set('similar_past_matches', 'none'))
->color(fn (Get $get): string => $get('similar_past_matches') != 'none' ? 'info' : 'gray')) ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'info' : 'gray'))
->placeholder('Similar Past Matches') ->placeholder('Similar Past Matches')
->suffix(fn (Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± '.$get('accuracy').'</div>') : '') ->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± ' . $get('accuracy') . '</div>') : '')
->prefix('SPM') ->prefix('SPM')
->prefixAction( ->prefixAction(
Action::make('iconInfo') Action::make('iconInfo')
->icon('phosphor-question-fill') ->icon('phosphor-question-fill')
// ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary') // ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary')
->color('success') ->color('success')
->tooltip(fn () => $this->tooltip_similar_past_matches()) ->tooltip(fn() => $this->tooltip_similar_past_matches())
) )
->default('none') ->default('none')
->selectablePlaceholder(false) ->selectablePlaceholder(false)
@@ -322,7 +320,7 @@ class Statistic extends BaseDashboard
Slider::make('accuracy') Slider::make('accuracy')
->live() ->live()
->hiddenLabel() ->hiddenLabel()
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') == 'none')
->fillTrack() ->fillTrack()
->minValue(0) ->minValue(0)
->maxValue(0.25) ->maxValue(0.25)
@@ -342,13 +340,13 @@ class Statistic extends BaseDashboard
->allowHtml() ->allowHtml()
->columnSpan(2) ->columnSpan(2)
->placeholder('Player') ->placeholder('Player')
->visible(fn (Get $get) => $get('team_id')) ->visible(fn(Get $get) => $get('team_id'))
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '') ->prefixIconColor(fn(Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
->prefixIcon('icon-player') ->prefixIcon('icon-player')
->preload() ->preload()
->searchable() ->searchable()
->extraAttributes(fn () => [ ->extraAttributes(fn() => [
'id' => 'player_selector', 'id' => 'player_selector',
'style' => 'width: 100%;', 'style' => 'width: 100%;',
]) ])
@@ -356,7 +354,7 @@ class Statistic extends BaseDashboard
Action::make('iconInfo') Action::make('iconInfo')
->icon('phosphor-question-fill') ->icon('phosphor-question-fill')
->color('success') ->color('success')
->tooltip(fn () => $this->tooltip_player_info()) ->tooltip(fn() => $this->tooltip_player_info())
) )
->options(function (Get $get) { ->options(function (Get $get) {
$team_id = $get('team_id'); $team_id = $get('team_id');
@@ -373,7 +371,7 @@ class Statistic extends BaseDashboard
->placeholder('Time on field') ->placeholder('Time on field')
->prefixIcon('phosphor-watch-fill') ->prefixIcon('phosphor-watch-fill')
->default('all') ->default('all')
->hidden(fn (Get $get) => ! $get('ss_player_id')) ->hidden(fn(Get $get) => ! $get('ss_player_id'))
->prefixIconColor('success') ->prefixIconColor('success')
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->options([ ->options([
@@ -394,7 +392,7 @@ class Statistic extends BaseDashboard
->extraAttributes([ ->extraAttributes([
'class' => 'radio-statistic-group', 'class' => 'radio-statistic-group',
]) ])
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->columnSpan(2) ->columnSpan(2)
->inline() ->inline()
->default('season') ->default('season')
@@ -413,8 +411,8 @@ class Statistic extends BaseDashboard
->multiple() ->multiple()
->placeholder('Current Season') ->placeholder('Current Season')
->prefixIconColor('success') ->prefixIconColor('success')
->visible(fn (Get $get) => $get('seasonmode')) ->visible(fn(Get $get) => $get('seasonmode'))
->hidden(fn (Get $get) => $get('seasonmode') == 'halfyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('seasonmode') == 'halfyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill') ->prefixIcon('phosphor-calendar-star-fill')
->options([ ->options([
'2026' => '2026', '2026' => '2026',
@@ -434,8 +432,8 @@ class Statistic extends BaseDashboard
->multiple() ->multiple()
->placeholder('Current Season') ->placeholder('Current Season')
->prefixIconColor('success') ->prefixIconColor('success')
->visible(fn (Get $get) => $get('seasonmode')) ->visible(fn(Get $get) => $get('seasonmode'))
->hidden(fn (Get $get) => $get('seasonmode') == 'fullyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('seasonmode') == 'fullyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill') ->prefixIcon('phosphor-calendar-star-fill')
->options([ ->options([
'26/27' => '26/27', '26/27' => '26/27',
@@ -451,39 +449,49 @@ class Statistic extends BaseDashboard
DatePicker::make('start_date') DatePicker::make('start_date')
->live() ->live()
->hiddenLabel() ->hiddenLabel()
->hidden(fn (Get $get) => $get('season_or_date') == 'season') ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false) ->native(false)
->prefixIconColor(fn (Get $get): string => $get('start_date') ? 'success' : 'primary') ->prefixIconColor(fn(Get $get): string => $get('start_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar-fill') ->prefixIcon('phosphor-calendar-fill')
->prefix('Start') ->prefix('Start')
->suffixAction( ->suffixAction(
Action::make('clear_start') Action::make('clear_start')
->icon('phosphor-x') ->icon('phosphor-x')
->color('gray') ->color('gray')
->action(fn (Set $set) => $set('start_date', null)) ->action(fn(Set $set) => $set('start_date', null))
), ),
DatePicker::make('end_date') DatePicker::make('end_date')
->live() ->live()
->hiddenLabel() ->hiddenLabel()
->hidden(fn (Get $get) => $get('season_or_date') == 'season') ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false) ->native(false)
->prefixIconColor(fn (Get $get): string => $get('end_date') ? 'success' : 'primary') ->prefixIconColor(fn(Get $get): string => $get('end_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar-fill') ->prefixIcon('phosphor-calendar-fill')
->prefix('End') ->prefix('End')
->suffixAction( ->suffixAction(
Action::make('clear_end') Action::make('clear_end')
->icon('phosphor-x') ->icon('phosphor-x')
->color('gray') ->color('gray')
->action(fn (Set $set) => $set('end_date', null)) ->action(fn(Set $set) => $set('end_date', null))
), ),
Action::make('esc') Actions::make([
->hiddenLabel() Action::make('esc')
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none') ->hiddenLabel()
->tooltip('Clear all (esc)') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->icon('phosphor-x-circle') ->tooltip('Clear all (esc)')
->color('gray') ->icon('phosphor-x-circle')
->keyBindings(['esc']) ->color(fn(Get $get) => $get('sofascore_category_id') ? 'warning' : 'gray')
->action('resetFilters'), ->keyBindings(['esc'])
->action('resetFilters'),
Action::make('copy')
->hiddenLabel()
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->visible(fn(Get $get) => $get('team_id'))
->tooltip('Copy data for pasting into spreadsheet')
->color('success')
->icon('phosphor-copy')
->action('resetFilters'),
])
]), ]),
]); ]);
} }
Generated
+17 -17
View File
@@ -2887,16 +2887,16 @@
}, },
{ {
"name": "kirschbaum-development/eloquent-power-joins", "name": "kirschbaum-development/eloquent-power-joins",
"version": "4.3.3", "version": "4.3.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/kirschbaum-development/eloquent-power-joins.git", "url": "https://github.com/kirschbaum-development/eloquent-power-joins.git",
"reference": "c609dbbe4ad2051b667e937f1ab554067519d64b" "reference": "a0e6c0420c381861e1830693c4b74bdac7f7fb5f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/kirschbaum-development/eloquent-power-joins/zipball/c609dbbe4ad2051b667e937f1ab554067519d64b", "url": "https://api.github.com/repos/kirschbaum-development/eloquent-power-joins/zipball/a0e6c0420c381861e1830693c4b74bdac7f7fb5f",
"reference": "c609dbbe4ad2051b667e937f1ab554067519d64b", "reference": "a0e6c0420c381861e1830693c4b74bdac7f7fb5f",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2944,9 +2944,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/kirschbaum-development/eloquent-power-joins/issues", "issues": "https://github.com/kirschbaum-development/eloquent-power-joins/issues",
"source": "https://github.com/kirschbaum-development/eloquent-power-joins/tree/4.3.3" "source": "https://github.com/kirschbaum-development/eloquent-power-joins/tree/4.3.4"
}, },
"time": "2026-07-23T11:41:37+00:00" "time": "2026-09-25T11:10:42+00:00"
}, },
{ {
"name": "laravel/framework", "name": "laravel/framework",
@@ -10229,16 +10229,16 @@
"packages-dev": [ "packages-dev": [
{ {
"name": "barryvdh/laravel-debugbar", "name": "barryvdh/laravel-debugbar",
"version": "v4.4.3", "version": "v4.4.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git", "url": "https://github.com/fruitcake/laravel-debugbar.git",
"reference": "caa08515a2eef6d8137653d3a1f3c3387cadf184" "reference": "02274537e13944ad1990c521bd06d0fb3578ba17"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/caa08515a2eef6d8137653d3a1f3c3387cadf184", "url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/02274537e13944ad1990c521bd06d0fb3578ba17",
"reference": "caa08515a2eef6d8137653d3a1f3c3387cadf184", "reference": "02274537e13944ad1990c521bd06d0fb3578ba17",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -10251,7 +10251,7 @@
}, },
"require-dev": { "require-dev": {
"larastan/larastan": "^3", "larastan/larastan": "^3",
"laravel/ai": "^0.8", "laravel/ai": "^0.8|^0.9|^0.10|^0.11|^1.0",
"laravel/octane": "^2", "laravel/octane": "^2",
"laravel/pennant": "^1", "laravel/pennant": "^1",
"laravel/pint": "^1", "laravel/pint": "^1",
@@ -10313,7 +10313,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues", "issues": "https://github.com/fruitcake/laravel-debugbar/issues",
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.4.3" "source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.4.4"
}, },
"funding": [ "funding": [
{ {
@@ -10325,7 +10325,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-09-01T13:46:43+00:00" "time": "2026-09-24T10:05:29+00:00"
}, },
{ {
"name": "brianium/paratest", "name": "brianium/paratest",
@@ -12303,11 +12303,11 @@
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
"version": "2.2.14", "version": "2.2.16",
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/9c672e7a8e791dfc3d30e55f683e73fc0b63a3ac", "url": "https://api.github.com/repos/phpstan/phpstan/zipball/46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92",
"reference": "9c672e7a8e791dfc3d30e55f683e73fc0b63a3ac", "reference": "46a6d9060e5a7763adfcc21ebcb8b504ebdbcb92",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -12363,7 +12363,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2026-09-12T21:39:33+00:00" "time": "2026-09-25T09:31:51+00:00"
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",