diff --git a/app/Console/Commands/Grapper/TxOdds.php b/app/Console/Commands/Grapper/TxOdds.php index ae755a40..20736ea1 100644 --- a/app/Console/Commands/Grapper/TxOdds.php +++ b/app/Console/Commands/Grapper/TxOdds.php @@ -5,7 +5,6 @@ namespace App\Console\Commands\Grapper; use App\Console\Commands\Grapper\TxOdds\Fixtures; use App\Console\Commands\Grapper\TxOdds\Odds; use App\Console\Commands\Nuh; -use App\Utilities\Notice; class TxOdds { @@ -15,11 +14,8 @@ class TxOdds case 'Fixtures': Fixtures::grap(); break; - case 'Odds': - Odds::grap(); - break; default: - Notice::note('prosses name does not exist', 'r', 1); + Odds::grap(); break; } } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds.php b/app/Console/Commands/Grapper/TxOdds/Odds.php index a550eb90..0c591dd1 100644 --- a/app/Console/Commands/Grapper/TxOdds/Odds.php +++ b/app/Console/Commands/Grapper/TxOdds/Odds.php @@ -25,6 +25,8 @@ use App\Models\Element; use App\Models\ElementGroup; use App\Models\Event; use App\Models\Group; +use App\Models\Supervisor; +use App\Models\TxoddsMarket; use App\Utilities\Notice; use Illuminate\Support\Carbon; @@ -49,110 +51,18 @@ class Odds Notice::note("Deleted: $info"); } - /************************************************* - * https://xml2.txodds.com/feed/odds_types.php - - * BETTYPE IDS - 0 3-WAY - 1 2-WAY - 3 POINTS - 4 TOTALS - - 131073 MONEY LINE - Q1 - - 65536 3-WAY HALF TIME - 65540 TOTALS HALF TIME - 65539 POINTS HALF TIME - - 131075 POINTS QUARTER TIME - 131076 TOTALS QUARTER TIME - - 5242880 DOUBLE CHANCE - 6291457 DRAW NO BET - 11534337 GG/NG (both teams to score) - 7340033 TO PROGRESS (to qualify) - - Not used: - 5 Asian - 131072 3 WAY QUARTER TIME - 262148 TOTALS OVER TIME - 262147 POINTS OVER TIME - - 65537 2-WAY HALF TIME - 327680 3-WAY 2ND HALF - 327681 2-WAY 2ND HALF - 327683 POINT 2ND HALF - 327684 TOTALS 2ND HALF - 1048577 GOAL / NO GOAL - - 2097153 ODD / EVEN - 4194304 TOTAL GOALS - 8388608 1X2 EURO HANDCIAP - 9437188 TOTAL CORNERS - 9502724 TOTAL CORNERS 1ST HALF - 20971520 3-WAY CORNERS - 28311555 HANDICAP SETS - 28311556 TOTAL SETS - - *************************************************/ - - switch (Nuh::$options['sport_id']) { - case 1: - /** - * 0 3-WAY - * 4 TOTALS - * 65536 3-WAY HALF TIME - * 65540 TOTALS HALF TIME - * 11534337 GG/NG (both teams to score) - * 5242880 DOUBLE CHANCE - * 7340033 TO PROGRESS (to qualify) - * 6291457 DRAW NO BET - */ - $markets = '0,4,65536,65540,11534337,5242880,7340033,6291457'; - break; - case 2: - /** - * 0 3-WAY - * 1 2-WAY - * 3 POINTS - * 4 TOTALS - * 131075 POINTS QUARTER TIME - * 131076 TOTALS QUARTER TIME - */ - $markets = '0,1,3,4,131076,131075'; - break; - case 3: - /** - * 1 2-WAY - * 3 POINTS - * 4 TOTALS - * 65539 POINTS HALF TIME - * 65540 TOTALS HALF TIME - * 131075 POINTS QUARTER TIME - * 131076 TOTALS QUARTER TIME - */ - $markets = '1,3,4,65539,65540,131075,131076'; - break; - case 5: - /** - * 1 2-WAY - * 131073 MONEY LINE - Q1 - * 3 POINTS - * 4 TOTALS - */ - $markets = '1,3,4,131073'; - break; - default: - Notice::note('sport not defined', 'r', 1); - break; - } + $txodds_markets_columns = [ + 1 => 'soccer', + 2 => 'ice_hockey', + 3 => 'basketball', + 5 => 'tennis', + ]; + $res = TxoddsMarket::where($txodds_markets_columns[Nuh::$options['sport_id']], 1)->pluck('market_id', 'id')->toArray(); /************************************************* * use_lastcall *************************************************/ - if (Nuh::$options['use_lastcall']) { - $lastcall = Nuh::$options['lastcall'] ? '&last='.Nuh::$options['lastcall'] : ''; - } + $markets = '&ot='.implode(',', $res); /************************************************* * URL @@ -162,75 +72,113 @@ class Odds } else { $AUTHTOKEN = 'ident=betaid2&passwd=Dy59vpRC'; } + $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.$AUTHTOKEN.'&all_odds=2'; $_calls = []; - if (Nuh::$options['id']) { + + $sport = '&spid='.Nuh::$options['sport_id']; + + if (Nuh::$options['provider_id'] == 8) { + + /************************************************* + * TXODDS MARKET LASTCALL + *************************************************/ + + if ($debug) { + Notice::note('TXOdds MARKET Lastcall', 'p'); + } + + $market = '&ot='.Nuh::$options['txodds_market_id']; + + $lastcall = Nuh::$options['lastcall'] > time() - 600 ? '&last='.Nuh::$options['lastcall'] : '&last='.time() - 600; + + $_calls[] = $url.$sport.$market.$lastcall; + + } elseif (Nuh::$options['id']) { + + /************************************************* + * BY ID + *************************************************/ + if ($debug) { Notice::note("BY ID \nsport_id: ".Nuh::$options['sport_id'], 'p'); } - /** - * by specific ID - */ - $_calls[] = $url."&ot=$markets&peid=".Nuh::$options['id']; + + $id = '&peid='.Nuh::$options['id']; + + $_calls[] = $url.$markets.$id; + } elseif (Nuh::$options['g']) { + + /************************************************* + * BY GROUP ID + *************************************************/ if ($debug) { Notice::note("GROUP_ID \nsport_id: ".Nuh::$options['sport_id'], 'p'); } - /** - * per group_id - * with from-to - */ + + $from_to = '&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to']; + $groupids = Event::where('starttime', '>', Carbon::now()->toDateTimeString())->groupBy('group_id')->pluck('group_id'); + foreach ($groupids as $groupid) { - $_calls[] = $url = 'https://xml2.txodds.com/feed/odds/xml.php?'.Nuh::$AUTHTOKEN.'&all_odds=2&ot='.$markets.'&days='.Nuh::$options['days_from'].','.Nuh::$options['days_to'].'&pgid='.$groupid; + $_calls[] = $url.$markets.$from_to.'&pgid='.$groupid; } + } elseif (Nuh::$options['t']) { + + /************************************************* + * TODAY by ID + *************************************************/ + if ($debug) { Notice::note("TODAY \nsport_id: ".Nuh::$options['sport_id'], 'p'); } - /** - * today - */ $from = Carbon::now()->toDateTimeString(); + $to = Carbon::now()->addDays(1)->toDateTimeString(); + $res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>=', $from)->where('starttime', '<', $to)->pluck('id'); foreach ($res as $id) { - $_calls[] = $url.'&spid='.Nuh::$options['sport_id']."&ot=$markets&peid=".$id; + $_calls[] = $url.$sport.$markets.'&peid='.$id; } + } elseif (Nuh::$options['w']) { + + /************************************************* + * ONE WEEK FROM NOW + *************************************************/ + if ($debug) { - Notice::note("WEEK \nsport_id: ".Nuh::$options['sport_id'], 'p'); + Notice::note("ONE WEEK FROM NOW \nsport_id: ".Nuh::$options['sport_id'], 'p'); } - /** - * week from now - */ + $res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->where('starttime', '<', Carbon::now()->addDays(7)->toDateTimeString())->pluck('id'); + foreach ($res as $id) { - $_calls[] = $url."&ot=$markets&peid=".$id; + $_calls[] = $url.$sport.$markets.'&peid='.$id; } - } else { + + } elseif (Nuh::$options['a']) { + + /************************************************* + * ALL BY ID (reload) + *************************************************/ + if ($debug) { Notice::note("ALL \nsport_id: ".Nuh::$options['sport_id'], 'p'); } - /** - * ALL by ID - */ - $res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id'); - foreach ($res as $id) { - $_calls[] = $url."&ot=$markets&peid=".$id; - } - if ($debug) { - Notice::note("LASTCALL \nsport_id: ".Nuh::$options['sport_id'], 'p'); - } - /** - * WITH LASTCALL Parameter - * with from-to days - */ - $_calls[] = $url.'&spid='.Nuh::$options['sport_id']."&ot=$markets&days=".Nuh::$options['days_from'].','.Nuh::$options['days_to'].$lastcall; + $res = Event::where('sport_id', Nuh::$options['sport_id'])->where('starttime', '>', Carbon::now()->toDateTimeString())->pluck('id'); + + foreach ($res as $id) { + $_calls[] = $url.$sport.$markets.'&peid='.$id; + } + } else { + Notice::note('BASH PARAMETER MISSING [--t, --w, --g, --a, --id=]', 'r', 1); } /************************************************* @@ -243,6 +191,10 @@ class Odds $data = Xml::load($url); + if (Nuh::$options['provider_id'] == 8) { + Supervisor::where('id', Nuh::$options['supervisor_id'])->update(['lastcall' => (int) $data['timestamp']]); + } + if ($debug) { Notice::note('counter: '.count($_calls).'/'.$counter, 'g'); } diff --git a/app/Console/Commands/Grapper/TxOdds/Odds/bettybes.txt b/app/Console/Commands/Grapper/TxOdds/Odds/bettybes.txt new file mode 100644 index 00000000..2d702445 --- /dev/null +++ b/app/Console/Commands/Grapper/TxOdds/Odds/bettybes.txt @@ -0,0 +1,97 @@ +/************************************************* +* https://xml2.txodds.com/feed/odds_types.php + +* BETTYPE IDS +0 3-WAY +1 2-WAY +3 POINTS +4 TOTALS + +131073 MONEY LINE - Q1 + +65536 3-WAY HALF TIME +65540 TOTALS HALF TIME +65539 POINTS HALF TIME + +131075 POINTS QUARTER TIME +131076 TOTALS QUARTER TIME + +5242880 DOUBLE CHANCE +6291457 DRAW NO BET +11534337 GG/NG (both teams to score) +7340033 TO PROGRESS (to qualify) + +Not used: +5 Asian +131072 3 WAY QUARTER TIME +262148 TOTALS OVER TIME +262147 POINTS OVER TIME + +65537 2-WAY HALF TIME +327680 3-WAY 2ND HALF +327681 2-WAY 2ND HALF +327683 POINT 2ND HALF +327684 TOTALS 2ND HALF +1048577 GOAL / NO GOAL + +2097153 ODD / EVEN +4194304 TOTAL GOALS +8388608 1X2 EURO HANDCIAP +9437188 TOTAL CORNERS +9502724 TOTAL CORNERS 1ST HALF +20971520 3-WAY CORNERS +28311555 HANDICAP SETS +28311556 TOTAL SETS + +*************************************************/ + +switch (Nuh::$options['sport_id']) { +case 1: + /** + * 0 3-WAY + * 4 TOTALS + * 65536 3-WAY HALF TIME + * 65540 TOTALS HALF TIME + * 11534337 GG/NG (both teams to score) + * 5242880 DOUBLE CHANCE + * 7340033 TO PROGRESS (to qualify) + * 6291457 DRAW NO BET + */ + $markets = '0,4,65536,65540,11534337,5242880,7340033,6291457'; + break; +case 2: + /** + * 0 3-WAY + * 1 2-WAY + * 3 POINTS + * 4 TOTALS + * 131075 POINTS QUARTER TIME + * 131076 TOTALS QUARTER TIME + */ + $markets = '0,1,3,4,131076,131075'; + break; +case 3: + /** + * 1 2-WAY + * 3 POINTS + * 4 TOTALS + * 65539 POINTS HALF TIME + * 65540 TOTALS HALF TIME + * 131075 POINTS QUARTER TIME + * 131076 TOTALS QUARTER TIME + */ + $markets = '1,3,4,65539,65540,131075,131076'; + break; +case 5: + /** + * 1 2-WAY + * 131073 MONEY LINE - Q1 + * 3 POINTS + * 4 TOTALS + */ + $markets = '1,3,4,131073'; + break; +default: + Notice::note('sport not defined', 'r', 1); + break; +} \ No newline at end of file diff --git a/app/Console/Commands/Nuh.php b/app/Console/Commands/Nuh.php index 5232d298..296bd35b 100644 --- a/app/Console/Commands/Nuh.php +++ b/app/Console/Commands/Nuh.php @@ -24,11 +24,7 @@ class Nuh extends Command public static $collector = []; - public static $BETSAPI_TOKEN = '36152-aeTRNnZxSPUwGe'; - - protected $signature = 'nuh {process=help} {--id=0} {--f=} {--p} {--d} {--x} {--t} {--w} {--g} {--r} {--s} {--t} {--q}'; - - protected $description = 'Nuh'; + protected $signature = 'nuh {process=help} {--id=0} {--f=} {--p} {--d} {--x} {--t} {--w} {--g} {--a} {--r} {--s} {--t} {--q}'; public function handle() { @@ -51,6 +47,7 @@ class Nuh extends Command $txt .= '--d debug'.PHP_EOL; $txt .= '--x generate supervisors'.PHP_EOL; $txt .= '--t load today'.PHP_EOL; + $txt .= '--a all by id'.PHP_EOL; $txt .= '--w laod this week (tx)'.PHP_EOL; $txt .= '--g by minor groups (tx)'.PHP_EOL; $txt .= '--r read data from file '.PHP_EOL; @@ -80,6 +77,7 @@ class Nuh extends Command switch (self::$options['provider_id']) { case 1: + case 8: TxOdds::switch(); break; case 2: diff --git a/app/Filament/Resources/Bettypes/Tables/BettypesTable.php b/app/Filament/Resources/Bettypes/Tables/BettypesTable.php index 3254712a..dac614d2 100644 --- a/app/Filament/Resources/Bettypes/Tables/BettypesTable.php +++ b/app/Filament/Resources/Bettypes/Tables/BettypesTable.php @@ -15,6 +15,7 @@ class BettypesTable { return $table ->striped() + ->recordAction(null) ->columns([ TextColumn::make('bettype_id') ->width('1rem') @@ -42,7 +43,7 @@ class BettypesTable ->toArray()), ]) ->recordActions([ - EditAction::make(), + EditAction::make()->hiddenLabel(), ]); } } diff --git a/app/Filament/Resources/Bookmakers/Tables/BookmakersTable.php b/app/Filament/Resources/Bookmakers/Tables/BookmakersTable.php index e8c4b5f1..59ac6387 100644 --- a/app/Filament/Resources/Bookmakers/Tables/BookmakersTable.php +++ b/app/Filament/Resources/Bookmakers/Tables/BookmakersTable.php @@ -15,6 +15,7 @@ class BookmakersTable { return $table ->striped() + ->recordAction(null) ->columns([ TextColumn::make('name') ->searchable(), @@ -38,7 +39,7 @@ class BookmakersTable TernaryFilter::make('is_active')->default(true), ]) ->recordActions([ - EditAction::make(), + EditAction::make()->hiddenLabel(), ]); } } diff --git a/app/Filament/Resources/Clients/Tables/ClientsTable.php b/app/Filament/Resources/Clients/Tables/ClientsTable.php index 58109412..3d44d38f 100644 --- a/app/Filament/Resources/Clients/Tables/ClientsTable.php +++ b/app/Filament/Resources/Clients/Tables/ClientsTable.php @@ -18,6 +18,7 @@ class ClientsTable { return $table ->striped() + ->recordAction(null) ->columns([ TextColumn::make('name'), TextColumn::make('bookmaker') @@ -48,7 +49,7 @@ class ClientsTable ->action(function ($record) { AlarmGenerator::run($record); }), - EditAction::make(), + EditAction::make()->hiddenLabel(), ]); } } diff --git a/app/Filament/Resources/CompetitionGroups/Tables/CompetitionGroupsTable.php b/app/Filament/Resources/CompetitionGroups/Tables/CompetitionGroupsTable.php index 13d50f67..09c88b8c 100644 --- a/app/Filament/Resources/CompetitionGroups/Tables/CompetitionGroupsTable.php +++ b/app/Filament/Resources/CompetitionGroups/Tables/CompetitionGroupsTable.php @@ -12,6 +12,7 @@ class CompetitionGroupsTable public static function configure(Table $table): Table { return $table + ->striped() ->columns([ IconColumn::make('sport.icon') ->label('') @@ -34,10 +35,6 @@ class CompetitionGroupsTable 'MEDIUM' => 'MEDIUM', 'LOW' => 'LOW', ]), - - ]) - ->filters([ - // ]); } } diff --git a/app/Filament/Resources/Countries/CountryResource.php b/app/Filament/Resources/Countries/CountryResource.php index 22ad129b..950be2f1 100644 --- a/app/Filament/Resources/Countries/CountryResource.php +++ b/app/Filament/Resources/Countries/CountryResource.php @@ -49,6 +49,7 @@ class CountryResource extends Resource { return $table ->striped() + ->recordAction(null) ->recordTitleAttribute('name') ->columns([ TextColumn::make('id')->searchable(), @@ -78,7 +79,7 @@ class CountryResource extends Resource ->query(fn (Builder $query): Builder => $query->whereNull('icon')), ]) ->recordActions([ - EditAction::make(), + EditAction::make()->hiddenLabel(), ]); } diff --git a/app/Filament/Resources/Providers/Tables/ProvidersTable.php b/app/Filament/Resources/Providers/Tables/ProvidersTable.php index bd054f18..db012b3c 100644 --- a/app/Filament/Resources/Providers/Tables/ProvidersTable.php +++ b/app/Filament/Resources/Providers/Tables/ProvidersTable.php @@ -12,12 +12,13 @@ class ProvidersTable { return $table ->striped() + ->recordAction(null) ->columns([ TextColumn::make('id')->alignCenter()->badge(), TextColumn::make('name'), ]) ->recordActions([ - EditAction::make(), + EditAction::make()->hiddenLabel(), ]); } } diff --git a/app/Filament/Resources/Supervisors/Schemas/SupervisorForm.php b/app/Filament/Resources/Supervisors/Schemas/SupervisorForm.php index fd470511..3e16df39 100644 --- a/app/Filament/Resources/Supervisors/Schemas/SupervisorForm.php +++ b/app/Filament/Resources/Supervisors/Schemas/SupervisorForm.php @@ -17,9 +17,9 @@ class SupervisorForm ->relationship('provider', 'name') ->required() ->preload(), - // Select::make('sport_id') - // ->relationship('sport', 'name') - // ->nullable(), + Select::make('sport_id') + ->relationship('sport', 'name') + ->nullable(), // TextInput::make('sleep')->default(30), // TextInput::make('maxsconds')->label('Seconds till throwing an error')->default(1800), diff --git a/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php b/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php index 49f7a679..721c817d 100644 --- a/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php +++ b/app/Filament/Resources/Supervisors/Tables/SupervisorsTable.php @@ -2,12 +2,16 @@ namespace App\Filament\Resources\Supervisors\Tables; +use App\Filament\Resources\Supervisors\Pages\ListSupervisors; use App\Models\Sport; use App\Models\Supervisor; +use App\Models\TxoddsMarket; use Filament\Actions\BulkAction; use Filament\Actions\BulkActionGroup; +use Filament\Actions\DeleteAction; use Filament\Actions\DeleteBulkAction; use Filament\Actions\EditAction; +use Filament\Forms\Components\TextInput; use Filament\Tables\Columns\Layout\Split; use Filament\Tables\Columns\Layout\Stack; use Filament\Tables\Columns\SelectColumn; @@ -26,6 +30,7 @@ class SupervisorsTable { return $table ->striped() + ->recordAction(null) ->poll('10s') ->columns([ Split::make([ @@ -33,12 +38,16 @@ class SupervisorsTable TextColumn::make('provider.name') ->color(fn ($record): string => match ($record->provider_id) { 1 => 'danger', + 8 => 'danger', 2 => 'success', default => 'warning', }), Stack::make([ SelectColumn::make('name') ->disablePlaceholderSelection() + ->hidden(function (ListSupervisors $livewire) { + return $livewire->tableFilters['provider_id']['value'] == 8; + }) ->options(function ($record) { switch ($record->provider_id) { case 1: @@ -60,50 +69,106 @@ class SupervisorsTable 'Betfair' => 'Betfair', ]; case 7: + /** + * functions for services + */ return [ 'Txodds Markets' => 'Txodds Markets', ]; default: return []; } - }), SelectColumn::make('sport_id') ->options(fn () => Sport::where('is_active', 1)->pluck('name', 'id')) ->placeholder('All'), + SelectColumn::make('txodds_market_id') + ->visible(function (ListSupervisors $livewire) { + return $livewire->tableFilters['provider_id']['value'] == 8; + }) + ->options(function ($record) { + switch ($record->sport_id) { + case 1: + return TxoddsMarket::where('soccer', 1)->pluck('name', 'market_id'); + case 2: + return TxoddsMarket::where('ice_hockey', 1)->pluck('name', 'market_id'); + case 3: + return TxoddsMarket::where('basketball', 1)->pluck('name', 'market_id'); + case 5: + return TxoddsMarket::where('tennis', 1)->pluck('name', 'market_id'); + } + }) + ->placeholder('All Markets'), ])->space(3), Stack::make([ - TextInputColumn::make('days_from')->prefix('Days Fm'), - TextInputColumn::make('days_to')->prefix('Days To'), + TextInputColumn::make('days_from')->prefix('Days Fm') + ->hidden(function (ListSupervisors $livewire) { + return $livewire->tableFilters['provider_id']['value'] == 8; + }), + TextInputColumn::make('days_to')->prefix('Days To') + ->hidden(function (ListSupervisors $livewire) { + return $livewire->tableFilters['provider_id']['value'] == 8; + }), ])->space(3), Stack::make([ + TextColumn::make('lastcall') + ->prefix('Lastcall: ') + ->badge() + ->color(fn ($state): string => ($state > 0 && $state > time() - 300) ? 'success' : 'danger') + ->dateTime() + ->visible(function (ListSupervisors $livewire) { + return $livewire->tableFilters['provider_id']['value'] == 8; + }), TextInputColumn::make('sleep')->prefix('Seep'), - TextInputColumn::make('commandline_options')->prefix('Bash'), + TextInputColumn::make('commandline_options')->prefix('Bash') + ->hidden(function (ListSupervisors $livewire) { + return $livewire->tableFilters['provider_id']['value'] == 8; + }), ])->space(3), - ToggleColumn::make('use_lastcall')->label('Lastcall')->tooltip('Use last call parameter'), + // ToggleColumn::make('use_lastcall')->label('Lastcall')->tooltip('Use last call parameter'), ToggleColumn::make('is_supervisor')->label('Super')->tooltip('Run as supervisor'), - ToggleColumn::make('is_active')->label('Active')->tooltip(('On/Off'))->onColor('success'), - TextColumn::make('runtime')->label('Run Time')->badge(), + ToggleColumn::make('is_active')->label('Active')->tooltip(('On/Off'))->onColor('success')->offColor('danger'), + TextColumn::make('runtime')->badge()->prefix('Runtime: '), ]), ]) ->filters([ SelectFilter::make('provider_id') ->default(1) + ->selectablePlaceholder(false) ->relationship('provider', 'name') ->label('Provider'), + SelectFilter::make('sport_id') + ->default(1) + ->relationship('sport', 'name') + ->label('Sport'), TernaryFilter::make('is_supervisor')->label('Run by supervisor'), TernaryFilter::make('is_active'), ], layout: FiltersLayout::AboveContent) ->deferFilters(false) ->recordActions([ EditAction::make()->hiddenLabel(), + DeleteAction::make()->hiddenLabel(), ]) ->toolbarActions([ BulkActionGroup::make([ + BulkAction::make('sleep') + ->label('Sleep') + ->icon('phosphor-timer') + ->action(function (Collection $records, array $data): void { + foreach ($records as $record) { + Supervisor::where('id', '=', $record->id) + ->update( + ['sleep' => $data['sleep']] + ); + } + }) + ->form([ + TextInput::make('sleep')->hiddenLabel()->prefix('Sleep'), + ]), BulkAction::make('Switch On') ->icon('phosphor-play') - ->action(function (Collection $records, array $data): void { + ->action(function (Collection $records): void { foreach ($records as $record) { Supervisor::where('id', '=', $record->id) ->update( @@ -113,7 +178,7 @@ class SupervisorsTable }), BulkAction::make('Switch Off') ->icon('phosphor-stop') - ->action(function (Collection $records, array $data): void { + ->action(function (Collection $records): void { foreach ($records as $record) { Supervisor::where('id', '=', $record->id) ->update( @@ -121,6 +186,26 @@ class SupervisorsTable ); } }), + BulkAction::make('As supervisor') + ->icon('phosphor-play') + ->action(function (Collection $records): void { + foreach ($records as $record) { + Supervisor::where('id', '=', $record->id) + ->update( + ['is_supervisor' => 1] + ); + } + }), + BulkAction::make('Not as supervisor') + ->icon('phosphor-stop') + ->action(function (Collection $records): void { + foreach ($records as $record) { + Supervisor::where('id', '=', $record->id) + ->update( + ['is_supervisor' => 0] + ); + } + }), DeleteBulkAction::make(), ]), diff --git a/app/Filament/Resources/Users/Tables/UsersTable.php b/app/Filament/Resources/Users/Tables/UsersTable.php index acce7a09..049b2394 100644 --- a/app/Filament/Resources/Users/Tables/UsersTable.php +++ b/app/Filament/Resources/Users/Tables/UsersTable.php @@ -13,6 +13,8 @@ class UsersTable public static function configure(Table $table): Table { return $table + ->striped() + ->recordAction(null) ->columns([ TextColumn::make('name') ->searchable(), @@ -36,7 +38,7 @@ class UsersTable ->action(function ($record) { BettypUserGenerator::run($record); }), - EditAction::make(), + EditAction::make()->hiddenLabel(), ]); } } diff --git a/app/Models/Supervisor.php b/app/Models/Supervisor.php index fca61203..67e4b896 100644 --- a/app/Models/Supervisor.php +++ b/app/Models/Supervisor.php @@ -10,6 +10,7 @@ class Supervisor extends Model 'name', 'provider_id', 'sport_id', + 'txodds_market_id', 'sleep', 'limit', 'runtime', @@ -31,4 +32,9 @@ class Supervisor extends Model { return $this->belongsTo(Provider::class); } + + public function txodds_market() + { + return $this->belongsTo(TxoddsMarket::class); + } } diff --git a/composer.lock b/composer.lock index f93b4145..715dac35 100644 --- a/composer.lock +++ b/composer.lock @@ -3874,16 +3874,16 @@ }, { "name": "livewire/livewire", - "version": "v3.7.3", + "version": "v3.7.4", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "a5384df9fbd3eaf02e053bc49aabc8ace293fc1c" + "reference": "5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/a5384df9fbd3eaf02e053bc49aabc8ace293fc1c", - "reference": "a5384df9fbd3eaf02e053bc49aabc8ace293fc1c", + "url": "https://api.github.com/repos/livewire/livewire/zipball/5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0", + "reference": "5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0", "shasum": "" }, "require": { @@ -3938,7 +3938,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.7.3" + "source": "https://github.com/livewire/livewire/tree/v3.7.4" }, "funding": [ { @@ -3946,7 +3946,7 @@ "type": "github" } ], - "time": "2025-12-19T02:00:29+00:00" + "time": "2026-01-13T09:37:21+00:00" }, { "name": "masterminds/html5", @@ -12815,12 +12815,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.3" }, - "platform-dev": {}, - "plugin-api-version": "2.9.0" + "platform-dev": [], + "plugin-api-version": "2.6.0" } diff --git a/database/migrations/2023_08_06_085243_create_supervisor_table.php b/database/migrations/2023_08_06_085243_create_supervisor_table.php index 1a7e979c..7cf0d53b 100644 --- a/database/migrations/2023_08_06_085243_create_supervisor_table.php +++ b/database/migrations/2023_08_06_085243_create_supervisor_table.php @@ -16,6 +16,7 @@ return new class extends Migration $table->string('name'); $table->integer('provider_id')->default(0)->nullable()->references('id')->on('providers'); $table->integer('sport_id')->references('id')->on('sports')->nullable(); + $table->integer('txodds_market_id')->references('market_id')->on('txodds_market')->nullable(); $table->integer('sleep')->default(30); $table->integer('limit')->default(0); diff --git a/database/seeders/ProvoiderSeeder.php b/database/seeders/ProvoiderSeeder.php index fba5c0be..956bd959 100644 --- a/database/seeders/ProvoiderSeeder.php +++ b/database/seeders/ProvoiderSeeder.php @@ -20,7 +20,8 @@ class ProvoiderSeeder extends Seeder ('4', 'MAGLOO NIGERIA'), ('5', 'LOGIFUTURE NIGERA'), ('6', 'LOGIFUTURE COLOMBIA'), - ('7', 'SERVICES'); + ('7', 'SERVICES'), + ('8', 'TXODDS MARKET'); "; DB::unprepared($sql); diff --git a/database/seeders/SupervisorSeeder.php b/database/seeders/SupervisorSeeder.php index 31ac1a4f..f13466cc 100644 --- a/database/seeders/SupervisorSeeder.php +++ b/database/seeders/SupervisorSeeder.php @@ -12,32 +12,59 @@ class SupervisorSeeder extends Seeder /** * Supervisor */ - $sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `sleep`, `limit`, `runtime`, `commandline_options`, `maxsconds`, `lastcall`, `use_lastcall`, `is_supervisor`, `is_active`, `days_from`, `days_to`, `created_at`, `updated_at`) + $sql = "INSERT INTO `supervisors` (`id`, `name`, `provider_id`, `sport_id`, `txodds_market_id`, `sleep`, `limit`, `runtime`, `commandline_options`, `maxsconds`, `lastcall`, `use_lastcall`, `is_supervisor`, `is_active`, `days_from`, `days_to`, `created_at`, `updated_at`) VALUES - (1, 'Fixtures', 1, 0, 10, 0, '0.14', NULL, 1800, 0, 0, 0, 1, 0, 0, '2025-08-27 07:39:55', '2026-01-13 06:06:47'), - (2, 'Odds', 1, 1, 10, 0, '0.251', NULL, 30, 0, 1, 1, 1, 0, 10, '2025-12-01 05:41:02', '2026-01-13 06:06:48'), - (3, 'Fixtures', 2, 0, 15, 0, '0.133', NULL, 1800, 0, 0, 0, 1, 0, 0, '2025-12-19 11:42:35', '2026-01-13 06:07:29'), - (4, 'Willhill', 2, 0, 15, 0, '2.119', NULL, 1800, 0, 0, 0, 1, 0, 0, '2025-12-19 11:48:05', '2026-01-13 06:07:33'), - (5, 'Bwin', 2, 0, 15, 0, '0.084', NULL, 1800, 0, 0, 0, 1, 0, 0, '2025-12-22 06:41:18', '2026-01-13 06:07:34'), - (6, 'Bet365', 2, 0, 10, 0, '0', NULL, 30, 0, 0, 1, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:35'), - (7, 'Betfair', 2, 0, 10, 0, '0', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:36'), - (8, 'Fixtures', 4, 0, 10, 0, '1.368', NULL, 30, 0, 0, 0, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:06:59'), - (9, 'Odds', 4, 0, 15, 0, NULL, NULL, 1800, 0, 0, 1, 1, 0, 0, '2026-01-03 12:27:44', '2026-01-13 06:06:57'), - (10, 'Fixtures', 3, 0, 10, 0, '1.368', NULL, 30, 0, 0, 0, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:04'), - (11, 'Odds', 3, 0, 15, 0, NULL, NULL, 1800, 0, 0, 1, 1, 0, 0, '2026-01-03 12:27:44', '2026-01-13 06:07:03'), - (12, 'Odds', 5, 1, 10, 0, '1.368', NULL, 30, 0, 0, 1, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:15'), - (13, 'Odds', 5, 3, 15, 0, NULL, NULL, 1800, 0, 0, 1, 1, 0, 0, '2026-01-03 12:27:44', '2026-01-13 06:07:13'), - (14, 'Odds', 5, 2, 10, 0, '1.368', NULL, 30, 0, 0, 1, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:14'), - (15, 'Odds', 5, 5, 15, 0, NULL, NULL, 1800, 0, 0, 1, 1, 0, 0, '2026-01-03 12:27:44', '2026-01-13 06:07:11'), - (16, 'Odds', 6, 1, 10, 0, '1.368', NULL, 30, 0, 0, 1, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:22'), - (17, 'Odds', 6, 3, 15, 0, NULL, NULL, 1800, 0, 0, 1, 1, 0, 0, '2026-01-03 12:27:44', '2026-01-13 06:07:20'), - (18, 'Odds', 6, 2, 10, 0, '1.368', NULL, 30, 0, 0, 1, 1, 0, 0, '2025-12-18 17:44:33', '2026-01-13 06:07:20'), - (19, 'Odds', 6, 5, 15, 0, NULL, NULL, 30, 0, 0, 1, 1, 0, 0, '2026-01-03 12:27:44', '2026-01-13 06:07:19'), - (20, 'Odds', 1, 3, 15, 0, NULL, NULL, 30, 0, 0, 1, 1, 0, 10, '2026-01-08 17:56:50', '2026-01-13 06:06:49'), - (21, 'Odds', 1, 2, 15, 0, NULL, NULL, 30, 0, 0, 1, 1, 0, 10, '2026-01-08 17:57:14', '2026-01-13 06:06:50'), - (22, 'Odds', 1, 5, 15, 0, NULL, NULL, 30, 0, 0, 1, 1, 0, 10, '2026-01-08 17:57:24', '2026-01-13 06:06:51'), - (23, 'Txodds Markets', 7, NULL, 15, 0, '0.006', NULL, 1800, 0, 0, 0, 1, NULL, NULL, '2026-01-13 05:55:30', '2026-01-13 06:41:35'); - "; + (1, 'Fixtures', 1, NULL, NULL, 10, 0, '0.407', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-08-27 07:39:55', '2026-01-14 15:56:21'), + (2, 'Odds', 1, 1, NULL, 10, 0, '1.483', NULL, 30, 0, 0, 1, 1, 0, 10, '2025-12-01 05:41:02', '2026-01-14 16:36:54'), + (3, 'Fixtures', 2, 0, NULL, 15, 0, '0.133', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:42:35', '2026-01-14 15:56:02'), + (4, 'Willhill', 2, 0, NULL, 15, 0, '2.119', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-19 11:48:05', '2026-01-14 15:56:02'), + (5, 'Bwin', 2, 0, NULL, 15, 0, '0.084', NULL, 1800, 0, 0, 0, 0, 0, 0, '2025-12-22 06:41:18', '2026-01-14 15:56:02'), + (6, 'Bet365', 2, 0, NULL, 10, 0, '0', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:56:02'), + (7, 'Betfair', 2, 0, NULL, 10, 0, '0', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:56:02'), + (8, 'Fixtures', 4, 1, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 0, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:29'), + (9, 'Odds', 4, 0, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:29'), + (10, 'Fixtures', 3, 0, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 0, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:25'), + (11, 'Odds', 3, 0, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:24'), + (12, 'Odds', 5, 1, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:39'), + (13, 'Odds', 5, 3, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:39'), + (14, 'Odds', 5, 2, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:55:39'), + (15, 'Odds', 5, 5, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:55:39'), + (16, 'Odds', 6, 1, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:52:55'), + (17, 'Odds', 6, 3, NULL, 15, 0, NULL, NULL, 1800, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:52:56'), + (18, 'Odds', 6, 2, NULL, 10, 0, '1.368', NULL, 30, 0, 0, 1, 0, 0, 0, '2025-12-18 17:44:33', '2026-01-14 15:52:57'), + (19, 'Odds', 6, 5, NULL, 15, 0, NULL, NULL, 30, 0, 0, 1, 0, 0, 0, '2026-01-03 12:27:44', '2026-01-14 15:52:58'), + (20, 'Odds', 1, 3, NULL, 15, 0, NULL, NULL, 30, 0, 0, 1, 0, 0, 10, '2026-01-08 17:56:50', '2026-01-14 15:52:42'), + (21, 'Odds', 1, 2, NULL, 15, 0, NULL, NULL, 30, 0, 0, 1, 0, 0, 10, '2026-01-08 17:57:14', '2026-01-14 15:52:43'), + (22, 'Odds', 1, 5, NULL, 15, 0, NULL, NULL, 30, 0, 0, 1, 0, 0, 10, '2026-01-08 17:57:24', '2026-01-14 15:52:44'), + (23, 'Txodds Markets', 7, NULL, NULL, 15, 0, '0.006', NULL, 1800, 0, 0, 0, 1, NULL, NULL, '2026-01-13 05:55:30', '2026-01-13 06:41:35'), + (24, '', 8, 1, 0, 30, 0, '0.067', NULL, 30, 1768405759, 0, 1, 0, 10, 10, '2026-01-14 15:42:40', '2026-01-14 17:22:36'), + (25, '', 8, 1, 4, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:25', '2026-01-14 17:20:08'), + (26, '', 8, 1, 65536, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:28', '2026-01-14 17:20:08'), + (27, '', 8, 1, 65540, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:31', '2026-01-14 17:20:08'), + (28, '', 8, 1, 5242880, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:56:34', '2026-01-14 17:20:08'), + (29, '', 8, 1, 6291457, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:57:05', '2026-01-14 17:20:08'), + (30, '', 8, 1, 7340033, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:57:08', '2026-01-14 17:20:08'), + (31, '', 8, 1, 11534337, 30, 0, NULL, NULL, 30, 0, 0, 1, 0, 10, 10, '2026-01-14 16:57:12', '2026-01-14 17:20:08'), + (32, '', 8, 3, 1, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:37:01', '2026-01-14 17:37:54'), + (33, '', 8, 3, 3, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:37:06', '2026-01-14 17:37:57'), + (34, '', 8, 3, 4, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:38:04', '2026-01-14 17:38:32'), + (35, '', 8, 3, 65539, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:38:12', '2026-01-14 17:38:34'), + (36, '', 8, 3, 65540, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:38:16', '2026-01-14 17:38:37'), + (37, '', 8, 3, 131075, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:38:21', '2026-01-14 17:38:41'), + (38, '', 8, 3, 131076, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:38:27', '2026-01-14 17:38:43'), + (39, '', 8, 2, 0, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:38:59', '2026-01-14 17:39:18'), + (40, '', 8, 2, 1, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:05', '2026-01-14 17:39:20'), + (41, '', 8, 2, 3, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:10', '2026-01-14 17:39:23'), + (42, '', 8, 2, 4, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:16', '2026-01-14 17:39:25'), + (43, '', 8, 2, 65539, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:34', '2026-01-14 17:39:52'), + (44, '', 8, 2, 65540, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:38', '2026-01-14 17:39:54'), + (45, '', 8, 2, 131075, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:42', '2026-01-14 17:39:56'), + (46, '', 8, 2, 131076, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:39:47', '2026-01-14 17:39:58'), + (47, '', 8, 5, 1, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:00', '2026-01-14 17:41:19'), + (48, '', 8, 5, 3, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:05', '2026-01-14 17:41:21'), + (49, '', 8, 5, 4, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:11', '2026-01-14 17:41:23'), + (50, '', 8, 5, 131073, 30, 0, NULL, NULL, 30, 0, 0, 0, 0, 10, 10, '2026-01-14 17:41:16', '2026-01-14 17:41:25'); +"; DB::unprepared($sql); } } diff --git a/setup.sh b/setup.sh index bc27f982..f1bfae04 100755 --- a/setup.sh +++ b/setup.sh @@ -42,18 +42,6 @@ case "$1" in php artisan config:clear php artisan view:clear ;; -"9") - a nuh --d --b 1 - a nuh --d --g 2 - a nuh --d --b 3 - a nuh --d 4 - a nuh --d 5 - a nuh --d --b 6 - a nuh --d --p 8 - a nuh --d --p 9 - a nuh --d --p 10 - a nuh --d --p 11 - ;; *) echo "" echo "--------------------------" @@ -67,7 +55,6 @@ case "$1" in echo "6 => a filament:assets (copy to prod)" echo "7 => a db:seed --force" echo "8 => a cache:clear view:clear" - echo "9 => grap all books all sports for 1 day" echo "--------------------------" echo "" ;;