diff --git a/app/Console/Commands/Grapper/TxOdds/Fixtures.php b/app/Console/Commands/Grapper/TxOdds/Fixtures.php index 94eee75f..baf19f19 100644 --- a/app/Console/Commands/Grapper/TxOdds/Fixtures.php +++ b/app/Console/Commands/Grapper/TxOdds/Fixtures.php @@ -18,6 +18,7 @@ class Fixtures $debug = Nuh::$options['d'] ?? 0; $echo = Nuh::$options['e'] ?? 0; $break = Nuh::$options['b'] ?? 0; + $week = Nuh::$options['w'] ?? 0; $count = 0; $total = 0; @@ -101,6 +102,10 @@ class Fixtures if ($break) { break; } + + if ($week && $i == 7) { + break; + } } if ($debug) { Notice::note("Total - $total events processed", 'g'); diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 9cefbe47..3da6c3e0 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -58,7 +58,7 @@ class EventsTable ->alignRight(), TextColumn::make('away.name') ->searchable(), - Columns3way::make('odds3way')->label(fn () => view('filament.tables.columns.multiline.label')), + Columns3way::make('odds3way')->label(fn () => view('filament.tables.columns.multiline.labels')), ]) ->poll('10s') ->defaultSort('starttime', 'ASC') diff --git a/app/Filament/Tables/Columns/Columns3way.php b/app/Filament/Tables/Columns/Columns3way.php index 66295b59..016c170d 100644 --- a/app/Filament/Tables/Columns/Columns3way.php +++ b/app/Filament/Tables/Columns/Columns3way.php @@ -13,6 +13,8 @@ class Columns3way extends Column protected ?array $fumetto; + protected ?bool $has_odds; + public function loadData($record, $multiline_client) { @@ -32,29 +34,7 @@ class Columns3way extends Column } } - // $this->multiline = []; - - // foreach ($multiline_client as $slot => $bookmaker) { - - // $open = true; - - // foreach ($this->fumetto as $item) { - // if ($item['bookmaker_id'] == $bookmaker->bookmaker_id) { - // $this->multiline[$slot] = $item; - // $open = false; - // } - // } - // if ($open) { - // $item = new stdClass; - // $item['icon'] = $bookmaker->bookmaker->icon; - // $item['h3w'] = 0; - // $item['d3w'] = 0; - // $item['a3w'] = 0; - // $item['margin'] = 0; - // $item['bookmaker_id'] = $bookmaker->bookmaker_id; - // $this->multiline[$slot] = $item; - // } - // } + $this->has_odds = count($this->multiline) ? true : false; } public function getMultilines(): ?array @@ -66,4 +46,9 @@ class Columns3way extends Column { return $this->fumetto; } + + public function hasodds() + { + return $this->has_odds; + } } diff --git a/app/Filament/Tables/Columns/OddsTooltipOff.php b/app/Filament/Tables/Columns/OddsTooltipOff.php deleted file mode 100644 index a367b40b..00000000 --- a/app/Filament/Tables/Columns/OddsTooltipOff.php +++ /dev/null @@ -1,70 +0,0 @@ -settings->has_3_columns; - } - - public function getFumetto() - { - return $this->fumetto; - } - - public function laodFumetto($event_id) - { - $systemSettings = app('systemSettings'); - - $this->settings = $systemSettings[auth()->user()->multiline_setting_id]; - - switch ($this->settings->table) { - case 'odds_2ways': - $this->fumetto = Odds2way::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_2ways_s1': - $this->fumetto = Odds2wayS1::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_3ways': - $this->fumetto = Odds3way::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_dc': - $this->fumetto = OddsDc::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_dnb': - $this->fumetto = OddsDnb::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_ggng': - $this->fumetto = OddsGgng::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_handicaps': - $this->fumetto = OddsHandicap::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_handicaps_q1': - $this->fumetto = OddsHandicapQ1::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_qualify': - $this->fumetto = OddsQualify::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_totals': - $this->fumetto = OddsTotal::with('bookmaker')->where('event_id', $event_id)->get(); - break; - case 'odds_totals_q1': - $this->fumetto = OddsTotalQ1::with('bookmaker')->where('event_id', $event_id)->get(); - break; - } - } -} diff --git a/app/Livewire/MonitorBettypeSwitch.php b/app/Livewire/BettypeToggle.php similarity index 76% rename from app/Livewire/MonitorBettypeSwitch.php rename to app/Livewire/BettypeToggle.php index 14dc4cf4..5194bc70 100644 --- a/app/Livewire/MonitorBettypeSwitch.php +++ b/app/Livewire/BettypeToggle.php @@ -6,7 +6,7 @@ use App\Models\MultilineSetting; use App\Models\User; use Livewire\Component; -class MonitorBettypeSwitch extends Component +class BettypeToggle extends Component { public $multilines = []; @@ -32,7 +32,7 @@ class MonitorBettypeSwitch extends Component public function render() { - return view('livewire.monitor-bettype-switch'); + return view('livewire.bettype-toggle'); } public function swopBettype($multiline_setting_id) @@ -41,4 +41,11 @@ class MonitorBettypeSwitch extends Component $this->js('window.location.reload()'); } + + public function toggleBettype($sport, $bettype, $status) + { + User::where('id', auth()->user()->id)->update(["bettype_status->$sport->$bettype" => $status]); + + $this->js('window.location.reload()'); + } } diff --git a/app/Models/User.php b/app/Models/User.php index 60530ae4..9df522c7 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -19,6 +19,10 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication /** @use HasFactory<\Database\Factories\UserFactory> */ use HasFactory, Notifiable; + protected $casts = [ + 'bettype_status' => 'json', + ]; + /** * The attributes that are mass assignable. * @@ -31,6 +35,7 @@ class User extends Authenticatable implements FilamentUser, HasAppAuthentication 'password', 'agb_akzeptiert', 'app_verified_at', + 'bettype_status', 'sport_id', ]; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index c1074884..2fa681f6 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -34,7 +34,7 @@ class AppServiceProvider extends ServiceProvider FilamentView::registerRenderHook( TablesRenderHook::TOOLBAR_SEARCH_AFTER, - fn (): string => Blade::render('@livewire(\'monitor-bettype-switch\')'), + fn (): string => Blade::render('@livewire(\'bettype-toggle\')'), scopes: [ ListEvents::class, ] diff --git a/composer.lock b/composer.lock index 4029be9a..16d241ad 100644 --- a/composer.lock +++ b/composer.lock @@ -4271,16 +4271,16 @@ }, { "name": "nette/utils", - "version": "v4.1.0", + "version": "v4.1.1", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "fa1f0b8261ed150447979eb22e373b7b7ad5a8e0" + "reference": "c99059c0315591f1a0db7ad6002000288ab8dc72" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/fa1f0b8261ed150447979eb22e373b7b7ad5a8e0", - "reference": "fa1f0b8261ed150447979eb22e373b7b7ad5a8e0", + "url": "https://api.github.com/repos/nette/utils/zipball/c99059c0315591f1a0db7ad6002000288ab8dc72", + "reference": "c99059c0315591f1a0db7ad6002000288ab8dc72", "shasum": "" }, "require": { @@ -4354,9 +4354,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.1.0" + "source": "https://github.com/nette/utils/tree/v4.1.1" }, - "time": "2025-12-01T17:49:23+00:00" + "time": "2025-12-22T12:14:32+00:00" }, { "name": "nikic/php-parser", @@ -10632,16 +10632,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.5", + "version": "5.6.6", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "90614c73d3800e187615e2dd236ad0e2a01bf761" + "reference": "5cee1d3dfc2d2aa6599834520911d246f656bcb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/90614c73d3800e187615e2dd236ad0e2a01bf761", - "reference": "90614c73d3800e187615e2dd236ad0e2a01bf761", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/5cee1d3dfc2d2aa6599834520911d246f656bcb8", + "reference": "5cee1d3dfc2d2aa6599834520911d246f656bcb8", "shasum": "" }, "require": { @@ -10651,7 +10651,7 @@ "phpdocumentor/reflection-common": "^2.2", "phpdocumentor/type-resolver": "^1.7", "phpstan/phpdoc-parser": "^1.7|^2.0", - "webmozart/assert": "^1.9.1" + "webmozart/assert": "^1.9.1 || ^2" }, "require-dev": { "mockery/mockery": "~1.3.5 || ~1.6.0", @@ -10690,9 +10690,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.5" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.6" }, - "time": "2025-11-27T19:50:05+00:00" + "time": "2025-12-22T21:13:58+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -12581,23 +12581,23 @@ }, { "name": "webmozart/assert", - "version": "1.12.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/webmozarts/assert.git", - "reference": "9be6926d8b485f55b9229203f962b51ed377ba68" + "reference": "1b34b004e35a164bc5bb6ebd33c844b2d8069a54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/9be6926d8b485f55b9229203f962b51ed377ba68", - "reference": "9be6926d8b485f55b9229203f962b51ed377ba68", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/1b34b004e35a164bc5bb6ebd33c844b2d8069a54", + "reference": "1b34b004e35a164bc5bb6ebd33c844b2d8069a54", "shasum": "" }, "require": { "ext-ctype": "*", "ext-date": "*", "ext-filter": "*", - "php": "^7.2 || ^8.0" + "php": "^8.2" }, "suggest": { "ext-intl": "", @@ -12607,7 +12607,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.10-dev" + "dev-feature/2-0": "2.0-dev" } }, "autoload": { @@ -12623,6 +12623,10 @@ { "name": "Bernhard Schussek", "email": "bschussek@gmail.com" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com" } ], "description": "Assertions to validate method input/output with nice error messages.", @@ -12633,9 +12637,9 @@ ], "support": { "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.12.1" + "source": "https://github.com/webmozarts/assert/tree/2.0.0" }, - "time": "2025-10-29T15:56:20+00:00" + "time": "2025-12-16T21:36:00+00:00" } ], "aliases": [], diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index cebc96f8..7ae88989 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -20,6 +20,7 @@ return new class extends Migration $table->integer('client_id'); $table->integer('sport_id')->default(1); $table->integer('multiline_setting_id')->nullable(); + $table->json('bettype_status')->nullable(); $table->boolean('super_admin')->default(false); $table->text('app_authentication_secret')->nullable(); diff --git a/package-lock.json b/package-lock.json index f37f407c..d8e299a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1990,7 +1990,6 @@ "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -2224,7 +2223,6 @@ "integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.27.0", "fdir": "^6.5.0", diff --git a/resources/js/app.js b/resources/js/app.js index e59d6a0a..eb10405f 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1 +1 @@ -import './bootstrap'; +import './bootstrap'; \ No newline at end of file diff --git a/resources/js/tabulator-js.js b/resources/js/tabulator-js.js deleted file mode 100644 index 78ccf0e7..00000000 --- a/resources/js/tabulator-js.js +++ /dev/null @@ -1,29 +0,0 @@ -var tabledata = [ - { id: 1, name: "Oli Bob", age: "12", col: "red", dob: "" }, - { id: 2, name: "Mary May", age: "1", col: "blue", dob: "14/05/1982" }, - { id: 3, name: "Christine Lobowski", age: "42", col: "green", dob: "22/05/1982" }, - { id: 4, name: "Brendon Philips", age: "125", col: "orange", dob: "01/08/1980" }, - { id: 5, name: "Margret Marmajuke", age: "16", col: "yellow", dob: "31/01/1999" }, -]; - - -// console.log('tabledata', tabledata); -import { TabulatorFull as Tabulator } from 'tabulator-tables'; - -var table = new Tabulator("#example-table", { - height: "311px", - data: tabledata, //assign data to table - layout: "fitColumns", //fit columns to width of table (optional) - columns: [ - { title: "Name", field: "name" }, - { title: "Progress", field: "progress", sorter: "number" }, - { title: "Gender", field: "gender" }, - { title: "Rating", field: "rating" }, - { title: "Favourite Color", field: "col" }, - { title: "Date Of Birth", field: "dob", hozAlign: "center" }, - ], -}); - -table.on("rowClick", function (e, row) { - alert("Row " + row.getData().id + " Clicked!!!!"); -}); \ No newline at end of file diff --git a/resources/views/filament/tables/columns/multiline/bkm.blade.php b/resources/views/filament/tables/columns/multiline/bkm.blade.php index eb466451..487951fe 100644 --- a/resources/views/filament/tables/columns/multiline/bkm.blade.php +++ b/resources/views/filament/tables/columns/multiline/bkm.blade.php @@ -3,7 +3,7 @@ @endphp @if (isset($icon)) -