fixtures new wip

This commit is contained in:
salam committed 2026-01-16 07:42:33 +01:00
1 parent a1057d55a7
commit 69619802ce
27 files changed
+156 -187

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
<?php
namespace App\Livewire\Mapper;
use App\Models\Mapper;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
class LoadProvider
{
public static function load($search_right)
{
if ($search_right) {
$searchValues = preg_split('/\s+/', $search_right, -1, PREG_SPLIT_NO_EMPTY);
return Mapper::query()
->where('sport_id', Auth::user()->sport_id)
->where('starttime', '>', Carbon::now())
->where('provider_id', Auth::user()->provider_id)
->where(function ($query) use ($searchValues) {
foreach ($searchValues as $value) {
$query->orWhere('home', 'LIKE', '%'.$value.'%')
->orWhere('away', 'LIKE', '%'.$value.'%');
}
});
} else {
return Mapper::query()
->where('sport_id', Auth::user()->sport_id)
->where('starttime', '>', Carbon::now())
->where('provider_id', Auth::user()->provider_id);
}
}
}