stuck with livewire mapchecker
This commit is contained in:
1 parent
5fb2916f19
commit
75d30353fc
10 files changed
+91
-85
No files matched your search
@@ -19,14 +19,16 @@ class MapChecker extends Component implements HasActions, HasSchemas, HasTable
|
||||
use InteractsWithSchemas;
|
||||
use InteractsWithTable;
|
||||
|
||||
public $id = 0;
|
||||
public $match_id = 0;
|
||||
|
||||
public $event_id = 0;
|
||||
|
||||
public function table(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->records(fn (): array => [
|
||||
1 => [
|
||||
'title' => 'First item',
|
||||
'title' => 'First item ',
|
||||
'slug' => 'first-item',
|
||||
'is_featured' => true,
|
||||
],
|
||||
@@ -42,7 +44,7 @@ class MapChecker extends Component implements HasActions, HasSchemas, HasTable
|
||||
],
|
||||
])
|
||||
->columns([
|
||||
TextColumn::make('title'),
|
||||
TextColumn::make('title')->label($this->match_id),
|
||||
TextColumn::make('slug'),
|
||||
IconColumn::make('is_featured')
|
||||
->boolean(),
|
||||
@@ -54,11 +56,6 @@ class MapChecker extends Component implements HasActions, HasSchemas, HasTable
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.map-checker');
|
||||
}
|
||||
|
||||
public function loadData($id)
|
||||
{
|
||||
$this->id = $id;
|
||||
return view('livewire.mapchecker');
|
||||
}
|
||||
}
|
||||
Generated
+39
-38
@@ -298,43 +298,44 @@
|
||||
},
|
||||
{
|
||||
"name": "bezhansalleh/filament-shield",
|
||||
"version": "4.0.3",
|
||||
"version": "4.0.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bezhanSalleh/filament-shield.git",
|
||||
"reference": "e2d33d8e3c5179d6824d26902056c03ee1c8e7d2"
|
||||
"reference": "9d67332c88d7363710dd9ca5ef077515b91e6996"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/e2d33d8e3c5179d6824d26902056c03ee1c8e7d2",
|
||||
"reference": "e2d33d8e3c5179d6824d26902056c03ee1c8e7d2",
|
||||
"url": "https://api.github.com/repos/bezhanSalleh/filament-shield/zipball/9d67332c88d7363710dd9ca5ef077515b91e6996",
|
||||
"reference": "9d67332c88d7363710dd9ca5ef077515b91e6996",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"bezhansalleh/filament-plugin-essentials": "^1.0",
|
||||
"filament/filament": "^4.0",
|
||||
"illuminate/contracts": "^11.28|^12.0",
|
||||
"illuminate/support": "*",
|
||||
"illuminate/support": "^11.28|^12.0",
|
||||
"php": "^8.2",
|
||||
"spatie/laravel-package-tools": "^1.9",
|
||||
"spatie/laravel-package-tools": "^1.92",
|
||||
"spatie/laravel-permission": "^6.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"larastan/larastan": "^2.2|^3.0",
|
||||
"laravel/pint": "^1.0",
|
||||
"nunomaduro/collision": "^7.0|^8.0",
|
||||
"orchestra/testbench": "^8.0|^9.0|^10.0",
|
||||
"pestphp/pest": "^2.0|^3.0",
|
||||
"pestphp/pest-plugin-laravel": "^2.0|^3.0",
|
||||
"pestphp/pest-plugin-livewire": "^3.0",
|
||||
"pestphp/pest-plugin-type-coverage": "^3.5",
|
||||
"larastan/larastan": "^3.8",
|
||||
"laravel/pint": "^1.26",
|
||||
"nunomaduro/collision": "^8.8",
|
||||
"orchestra/testbench": "^10.8",
|
||||
"pestphp/pest": "^3.8|^4.0",
|
||||
"pestphp/pest-plugin-laravel": "^3.2|^4.0",
|
||||
"pestphp/pest-plugin-livewire": "^3.0|^4.0",
|
||||
"pestphp/pest-plugin-type-coverage": "^3.6|^4.0",
|
||||
"phpstan/extension-installer": "^1.4",
|
||||
"phpstan/phpstan": "^2.1",
|
||||
"phpstan/phpstan-deprecation-rules": "^2.0",
|
||||
"phpstan/phpstan-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "^10.1|^11.0",
|
||||
"rector/rector": "^2.1",
|
||||
"spatie/laravel-ray": "^1.40"
|
||||
"phpunit/phpunit": "^11.5",
|
||||
"rector/jack": "^0.4.0",
|
||||
"rector/rector": "^2.2",
|
||||
"spatie/laravel-ray": "^1.43"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
@@ -380,7 +381,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/bezhanSalleh/filament-shield/issues",
|
||||
"source": "https://github.com/bezhanSalleh/filament-shield/tree/4.0.3"
|
||||
"source": "https://github.com/bezhanSalleh/filament-shield/tree/4.0.4"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -388,7 +389,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-11-29T20:33:45+00:00"
|
||||
"time": "2025-12-26T09:31:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "blade-ui-kit/blade-heroicons",
|
||||
@@ -9214,16 +9215,16 @@
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "barryvdh/laravel-debugbar",
|
||||
"version": "v3.16.2",
|
||||
"version": "v3.16.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-debugbar.git",
|
||||
"reference": "730dbf8bf41f5691e026dd771e64dd54ad1b10b3"
|
||||
"reference": "c91e57ea113edd6526f5b8cd6b1c6ee02c67b28e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/730dbf8bf41f5691e026dd771e64dd54ad1b10b3",
|
||||
"reference": "730dbf8bf41f5691e026dd771e64dd54ad1b10b3",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/c91e57ea113edd6526f5b8cd6b1c6ee02c67b28e",
|
||||
"reference": "c91e57ea113edd6526f5b8cd6b1c6ee02c67b28e",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -9232,7 +9233,7 @@
|
||||
"illuminate/support": "^10|^11|^12",
|
||||
"php": "^8.1",
|
||||
"php-debugbar/php-debugbar": "^2.2.4",
|
||||
"symfony/finder": "^6|^7"
|
||||
"symfony/finder": "^6|^7|^8"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.3.3",
|
||||
@@ -9283,7 +9284,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/barryvdh/laravel-debugbar/issues",
|
||||
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.16.2"
|
||||
"source": "https://github.com/barryvdh/laravel-debugbar/tree/v3.16.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -9295,7 +9296,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-12-03T14:52:46+00:00"
|
||||
"time": "2025-12-23T17:37:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "brianium/paratest",
|
||||
@@ -10760,16 +10761,16 @@
|
||||
},
|
||||
{
|
||||
"name": "php-debugbar/php-debugbar",
|
||||
"version": "v2.2.5",
|
||||
"version": "v2.2.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-debugbar/php-debugbar.git",
|
||||
"reference": "c5dce08e98dd101c771e55949fd89124b216271d"
|
||||
"reference": "abb9fa3c5c8dbe7efe03ddba56782917481de3e8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/c5dce08e98dd101c771e55949fd89124b216271d",
|
||||
"reference": "c5dce08e98dd101c771e55949fd89124b216271d",
|
||||
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/abb9fa3c5c8dbe7efe03ddba56782917481de3e8",
|
||||
"reference": "abb9fa3c5c8dbe7efe03ddba56782917481de3e8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -10828,9 +10829,9 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
|
||||
"source": "https://github.com/php-debugbar/php-debugbar/tree/v2.2.5"
|
||||
"source": "https://github.com/php-debugbar/php-debugbar/tree/v2.2.6"
|
||||
},
|
||||
"time": "2025-12-21T08:50:08+00:00"
|
||||
"time": "2025-12-22T13:21:32+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpdocumentor/reflection-common",
|
||||
@@ -11553,16 +11554,16 @@
|
||||
},
|
||||
{
|
||||
"name": "rector/rector",
|
||||
"version": "2.2.14",
|
||||
"version": "2.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/rectorphp/rector.git",
|
||||
"reference": "6d56bb0e94d4df4f57a78610550ac76ab403657d"
|
||||
"reference": "f7166355dcf47482f27be59169b0825995f51c7d"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/rectorphp/rector/zipball/6d56bb0e94d4df4f57a78610550ac76ab403657d",
|
||||
"reference": "6d56bb0e94d4df4f57a78610550ac76ab403657d",
|
||||
"url": "https://api.github.com/repos/rectorphp/rector/zipball/f7166355dcf47482f27be59169b0825995f51c7d",
|
||||
"reference": "f7166355dcf47482f27be59169b0825995f51c7d",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -11601,7 +11602,7 @@
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/rectorphp/rector/issues",
|
||||
"source": "https://github.com/rectorphp/rector/tree/2.2.14"
|
||||
"source": "https://github.com/rectorphp/rector/tree/2.3.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
@@ -11609,7 +11610,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2025-12-09T10:57:55+00:00"
|
||||
"time": "2025-12-25T22:00:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
|
||||
Generated
+2
@@ -1990,6 +1990,7 @@
|
||||
"integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
@@ -2223,6 +2224,7 @@
|
||||
"integrity": "sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"esbuild": "^0.27.0",
|
||||
"fdir": "^6.5.0",
|
||||
|
||||
@@ -1,14 +1,19 @@
|
||||
<li class="bg-white dark:bg-gray-900 w-full h-full overflow-hidden p-1 cursor-grab flex space-x-10 drag-and-drop__item"
|
||||
mapper="left" id={{ $record->id }}
|
||||
x-data="{ moveoverleft: false }" id={{ $record->id }}
|
||||
x-on:dragstart.self="
|
||||
dragging = true;
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
event.dataTransfer.setData('text/plain', event.target.id);"
|
||||
dragging = true;
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
event.dataTransfer.setData('text/plain', event.target.id);"
|
||||
x-on:dragover.prevent="moveoverleft = true" x-on:dragleave.prevent="moveoverleft = false"
|
||||
x-on:drop="moveoverleft = false" :class="moveoverleft ? 'bg-green-500/10!' : ''"
|
||||
x-on:drop.prevent="
|
||||
const id = event.dataTransfer.getData('text/plain');
|
||||
const target = event.target.closest('li');
|
||||
console.log('left', id, target.id, target.getAttribute('mapper'));"
|
||||
draggable="true">
|
||||
{{-- console.log(document.getElementById(id).getAttribute('mapper'), id, target.id, target.getAttribute('mapper')); --}}
|
||||
if(document.getElementById(id).getAttribute('mapper') !=target.getAttribute('mapper'))
|
||||
$dispatch('mapchecker', { event_id: id, match_id:target.id });"
|
||||
draggable="true" mapper="left">
|
||||
{{-- @livewire('child', ['matchid' => id])" --}}
|
||||
|
||||
<div class="w-6 flex-none mx-auto my-auto">
|
||||
@if ($record->country->iso2)
|
||||
@@ -19,24 +24,23 @@
|
||||
</div>
|
||||
|
||||
<div class="flex-1 flex flex-col justify-center space-y-0">
|
||||
<div class="flex justify-center text-primary-500">{{ $record->starttime }}</div>
|
||||
<div class="flex justify-around text-gray-600 dark:text-gray-500">
|
||||
<div>{{ $record->starttime }}</div>
|
||||
<div>{{ $record->id }}</div>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-4">
|
||||
<div class="text-right font-bold">{{ $record->home->name }}</div>
|
||||
<div class="w-6 text-center">-</div>
|
||||
<div class="text-left font-bold">{{ $record->away->name }}</div>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-4">
|
||||
<div class="flex justify-center space-x-4 text-gray-600 dark:text-gray-500">
|
||||
<div>{{ $record->country?->name }}</div>
|
||||
<div>{{ $record->competition_group->name }}</div>
|
||||
<x-filament::badge>
|
||||
{{ $record->id }}
|
||||
</x-filament::badge>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="w-6 flex-none my-auto">
|
||||
<x-filament::icon-button icon="heroicon-o-arrows-pointing-out" />
|
||||
</div>
|
||||
</li>
|
||||
{{-- if(target.mapper =='left') --}}
|
||||
{{-- $dispatch('map-checker',{ 'id': id, 'target':target.id });" --}}
|
||||
@@ -1,36 +1,38 @@
|
||||
<li class="bg-white dark:bg-gray-900 w-full h-full overflow-hidden p-1 cursor-grab flex space-x-10 drag-and-drop__item"
|
||||
mapper="right" id={{ $record->event_id }}
|
||||
<li class="bg-white dark:bg-gray-900 w-full h-full overflow-hidden p-1 cursor-grab flex
|
||||
space-x-10 drag-and-drop__item"
|
||||
x-data="{ moveoverright: false }" id={{ $record->event_id }}
|
||||
x-on:dragstart.self="
|
||||
dragging = true;
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
event.dataTransfer.setData('text/plain', event.target.id);
|
||||
"
|
||||
dragging = true;
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
event.dataTransfer.setData('text/plain', event.target.id);"
|
||||
x-on:dragover.prevent="moveoverright = true" x-on:dragleave.prevent="moveoverright = false"
|
||||
x-on:drop="moveoverright = false" :class="moveoverright ? 'bg-blue-500/10!' : ''"
|
||||
x-on:drop.prevent="
|
||||
const id = event.dataTransfer.getData('text/plain');
|
||||
const target = event.target.closest('li');
|
||||
console.log('right', id, target.id, target.getAttribute('mapper'));"
|
||||
draggable="true">
|
||||
{{-- console.log(document.getElementById(id).getAttribute('mapper'), id, target.id, target.getAttribute('mapper'));" --}}
|
||||
if(document.getElementById(id).getAttribute('mapper') !=target.getAttribute('mapper'))
|
||||
$dispatch('mapchecker', { match_id: id, event_id:target.id });"
|
||||
draggable="true" mapper="right">
|
||||
{{-- $dispatch('map-checker', { match_id: id, event_id:target.id });" --}}
|
||||
|
||||
<div class="w-6 flex-none my-auto">
|
||||
<x-filament::icon-button icon="heroicon-o-arrows-pointing-out" />
|
||||
</div>
|
||||
<div class="flex-1 flex flex-col justify-center space-y-0">
|
||||
<div class="flex justify-center text-primary-500">
|
||||
{{ $record->starttime }}
|
||||
<div class="flex justify-around text-gray-600 dark:text-gray-500">
|
||||
<div>{{ $record->starttime }}</div>
|
||||
<div>{{ $record->event_id }}</div>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-4">
|
||||
<div class="text-right font-bold">{{ $record->home }}</div>
|
||||
<div class="w-6 text-center">-</div>
|
||||
<div class="text-left font-bold">{{ $record->away }}</div>
|
||||
</div>
|
||||
<div class="flex justify-center space-x-4">
|
||||
<div class="flex justify-center space-x-4 text-gray-600 dark:text-gray-500">
|
||||
<div>{{ $record->country_betsapi?->name }}</div>
|
||||
<div>{{ $record->group }}</div>
|
||||
<x-filament::badge>
|
||||
{{ $record->event_id }}
|
||||
</x-filament::badge>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="w-6 flex-none mx-auto my-auto">
|
||||
@@ -39,5 +41,3 @@
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
{{-- if(target.mapper =='right') --}}
|
||||
{{-- $dispatch('map-checker',{ 'target': id, 'id':target.id });" --}}
|
||||
@@ -1,3 +0,0 @@
|
||||
<div>
|
||||
{{ $this->table }}
|
||||
</div>
|
||||
@@ -0,0 +1,5 @@
|
||||
<div @mapchecker.window="console.log('match_id', $event.detail.match_id, 'event_id', $event.detail.event_id);">
|
||||
{{ $this->table }}
|
||||
</div>
|
||||
{{-- @notify="alert($event.detail.message)" --}}
|
||||
{{-- @wire.set --}}
|
||||
@@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<ul class="drag-and-drop__items" x-on:dragover.prevent="removing = true" x-on:dragleave.prevent="removing = false">
|
||||
<ul class="drag-and-drop__items">
|
||||
{{ $this->table }}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -1,5 +1,5 @@
|
||||
<div>
|
||||
<ul class="drag-and-drop__items" x-on:dragover.prevent="removing = true" x-on:dragleave.prevent="removing = false">
|
||||
<ul class="drag-and-drop__items">
|
||||
{{ $this->table }}
|
||||
</ul>
|
||||
</div>
|
||||
@@ -20,7 +20,7 @@
|
||||
Event Mapper
|
||||
</x-slot>
|
||||
|
||||
<div class="grid grid-cols-2 gap-4 drag-and-drop text-sm" x-data="{ adding: false, removing: false }">
|
||||
<div class="grid grid-cols-2 gap-4 drag-and-drop text-sm" x-data="{ event_id: 0, match_id: 0, overleftcolumn: false, overrightcolumn: false }">
|
||||
<div>
|
||||
@livewire('mapper-left')
|
||||
</div>
|
||||
@@ -32,8 +32,8 @@
|
||||
|
||||
|
||||
{{-- START MAP CHECKER MODAL --}}
|
||||
<x-filament::modal @map-checker.window="isOpen = true">
|
||||
@livewire('map-checker')
|
||||
<x-filament::modal @mapchecker.window="isOpen = true">
|
||||
@livewire('mapchecker', ['match_id' => $event . detail . match_id])
|
||||
</x-filament::modal>
|
||||
{{-- END MAP CHECKER MODAL --}}
|
||||
|
||||
|
||||
Reference in new issue
Block a user