wip
This commit is contained in:
1 parent
a26c555b05
commit
cec5a5e2f7
20 files changed
+211
-120
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user