This commit is contained in:
salam committed 2026-01-01 13:32:19 +01:00
1 parent a26c555b05
commit cec5a5e2f7
20 files changed
+211 -120

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
<?php
namespace App\Mapper;
use App\Models\Event;
use App\Models\Mapper;
use Illuminate\Support\Facades\Auth;
class FindEvent
{
public static function search($event)
{
dd($event);
$event_id = $event['event_id'];
$match_id = Event::where('betsapi_id', $event_id)->value('id');
if ($match_id) {
Mapper::where('event_id', $event_id)->delete();
} else {
Mapper::updateOrCreate(['event_id' => $event_id], $event);
}
return Mapper::query()->where('sport_id', Auth::user()->sport_id)->where('provider_id', Auth::user()->provider_id);
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
namespace App\Mapper;
use App\Models\Event;
use Illuminate\Support\Facades\Auth;
class LoadEvents
{
public static function load()
{
switch (Auth::user()->provider_id) {
case 2:
// BETSAPI
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('betsapi_id', 0);
break;
case 20:
// Magloo Kenia
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('magnig_id', 0);
break;
case 24:
// Magloo Nigeria
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('magken_id', 0);
break;
case 26:
// Logifuture Nigeria
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('lognig_id', 0);
break;
case 27:
// Magloo Colombia
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('logcol_id', 0);
break;
default:
return Event::query()->where('sport_id', Auth::user()->sport_id)->where('betradar_id', 0);
break;
}
}
}
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace App\Mapper;
use App\Models\Mapper;
use Illuminate\Support\Facades\Auth;
class LoadProvider
{
public static function load()
{
return Mapper::query()->where('sport_id', Auth::user()->sport_id)->where('provider_id', Auth::user()->provider_id);
}
}