fix policies
This commit is contained in:
1 parent
109907d1f3
commit
f8e6f8183b
10 files changed
+359
-318
No files matched your search
@@ -8,16 +8,29 @@ use App\Console\Commands\Grapper\Sofascore\Helper\LoadDays;
|
|||||||
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
use App\Console\Commands\Grapper\Sofascore\Helper\Sleeper;
|
||||||
use App\Console\Commands\Nuh;
|
use App\Console\Commands\Nuh;
|
||||||
use App\Models\SofaScoreDayTournament;
|
use App\Models\SofaScoreDayTournament;
|
||||||
|
use App\Models\SofaScoreEventGrapped;
|
||||||
use App\Models\SofaScoreTaskTournament;
|
use App\Models\SofaScoreTaskTournament;
|
||||||
use App\Utilities\Notice;
|
use App\Utilities\Notice;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
|
|
||||||
class Grapper
|
class Grapper
|
||||||
{
|
{
|
||||||
public static function load()
|
public static function load()
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* yesterday
|
||||||
|
*
|
||||||
|
* nuh --d --f 67 --fun=6 --task=1
|
||||||
|
*
|
||||||
|
* 1783710000
|
||||||
|
* 10 July 2026 09:00:00 PM CEST
|
||||||
|
*/
|
||||||
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
|
|
||||||
|
$force = Nuh::$options['f'] ?? 0;
|
||||||
|
|
||||||
$task_id = Nuh::$options['task'] ?? 0;
|
$task_id = Nuh::$options['task'] ?? 0;
|
||||||
|
|
||||||
$days = LoadDays::load();
|
$days = LoadDays::load();
|
||||||
@@ -49,7 +62,7 @@ class Grapper
|
|||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
dd($data);
|
// dd($data);
|
||||||
|
|
||||||
Nuh::$options['s'] = 0;
|
Nuh::$options['s'] = 0;
|
||||||
|
|
||||||
@@ -59,88 +72,102 @@ class Grapper
|
|||||||
|
|
||||||
foreach ($data['events'] as $event) {
|
foreach ($data['events'] as $event) {
|
||||||
|
|
||||||
dd($event);
|
$now = Carbon::now()->subHours(4);
|
||||||
|
$starttime = Carbon::createFromTimestamp($event->startTimestamp);
|
||||||
|
|
||||||
// "hasEventPlayerStatistics" => true
|
if ($now->greaterThan($starttime)) {
|
||||||
|
|
||||||
$folder = Sofascore::$grapper_path . $day . '/' . $event['tournament']['slug'] . '/' . $event['slug'];
|
$event_grapped = SofaScoreEventGrapped::where('id', $event['id'])->first();
|
||||||
|
$event_grapped['name'] = $event->homeTeam['name'] . ' vs ' . $event->awayTeam['name'];
|
||||||
|
$event_grapped['url'] = $url;
|
||||||
|
|
||||||
File::makeDirectory($folder, 0775, true, true);
|
$folder = Sofascore::$grapper_path . $day . '/' . $event['tournament']['slug'] . '/' . $event['slug'];
|
||||||
|
|
||||||
/*********************************
|
File::makeDirectory($folder, 0775, true, true);
|
||||||
* EVENT event
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
File::put($folder . '/event.json', json_encode($event));
|
/*********************************
|
||||||
|
* EVENT event
|
||||||
|
*********************************/
|
||||||
|
|
||||||
/*********************************
|
File::put($folder . '/event.json', json_encode($event));
|
||||||
* EVENT statistics
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
$event_id = $event['id'];
|
/*********************************
|
||||||
|
* EVENT statistics
|
||||||
|
*********************************/
|
||||||
|
|
||||||
if (!File::exists($folder . '/statistics.json')) {
|
$event_id = $event['id'];
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
if ($force || !$event_grapped['got_statistics'] && $event->hasEventPlayerStatistics) {
|
||||||
|
|
||||||
Sleeper::rand();
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/statistics";
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
Sleeper::rand();
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
File::put($folder . '/statistics.json', json_encode($data));
|
$data['id'] = $event_id;
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************
|
File::put($folder . '/statistics.json', json_encode($data));
|
||||||
* EVENT lineups
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
if (!File::exists($folder . '/lineups.json')) {
|
$event_grapped['got_statistics'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
/*********************************
|
||||||
|
* EVENT lineups
|
||||||
|
*********************************/
|
||||||
|
|
||||||
Sleeper::rand();
|
if ($force || !$event_grapped['got_lineups']) {
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/lineups";
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
Sleeper::rand();
|
||||||
|
|
||||||
File::put($folder . '/lineups.json', json_encode($data));
|
$data = CurlSofa::load($url);
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************
|
$data['id'] = $event_id;
|
||||||
* EVENT odds
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
if (!File::exists($folder . '/odds.json')) {
|
File::put($folder . '/lineups.json', json_encode($data));
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
$event_grapped['got_lineups'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
Sleeper::rand();
|
/*********************************
|
||||||
|
* EVENT odds
|
||||||
|
*********************************/
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
if ($force || !$event_grapped['got_odds']) {
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/odds/1/all";
|
||||||
|
|
||||||
File::put($folder . '/odds.json', json_encode($data));
|
Sleeper::rand();
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************
|
$data = CurlSofa::load($url);
|
||||||
* EVENT incidents
|
|
||||||
*********************************/
|
|
||||||
|
|
||||||
if (!File::exists($folder . '/incidents.json')) {
|
$data['id'] = $event_id;
|
||||||
|
|
||||||
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents";
|
File::put($folder . '/odds.json', json_encode($data));
|
||||||
|
|
||||||
Sleeper::rand();
|
$event_grapped['got_odds'] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
$data = CurlSofa::load($url);
|
/*********************************
|
||||||
|
* EVENT incidents
|
||||||
|
*********************************/
|
||||||
|
|
||||||
$data['id'] = $event_id;
|
if ($force || !$event_grapped['got_incidents']) {
|
||||||
|
|
||||||
File::put($folder . '/incidents.json', json_encode($data));
|
$url = Nuh::$options['base_url'] . "api/v1/event/$event_id/incidents";
|
||||||
|
|
||||||
|
Sleeper::rand();
|
||||||
|
|
||||||
|
$data = CurlSofa::load($url);
|
||||||
|
|
||||||
|
$data['id'] = $event_id;
|
||||||
|
|
||||||
|
File::put($folder . '/incidents.json', json_encode($data));
|
||||||
|
|
||||||
|
$event_grapped['got_incidents'] = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,13 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class SofaScoreEventGrapped extends Model
|
class SofaScoreEventGrapped extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'event_id',
|
'id',
|
||||||
'name',
|
'name',
|
||||||
|
'url',
|
||||||
'starttime',
|
'starttime',
|
||||||
|
'got_statistics',
|
||||||
|
'got_lineups',
|
||||||
|
'got_odds',
|
||||||
|
'got_incidents',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,65 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\SofaScoreTask;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class SofaScoreTaskPolicy
|
class SofaScoreTaskPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:SofaScoreTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, SofaScoreTask $sofaScoreTask): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:SofaScoreTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:SofaScoreTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, SofaScoreTask $sofaScoreTask): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:SofaScoreTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, SofaScoreTask $sofaScoreTask): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:SofaScoreTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, SofaScoreTask $sofaScoreTask): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:SofaScoreTask');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, SofaScoreTask $sofaScoreTask): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:SofaScoreTask');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:SofaScoreTask');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:SofaScoreTask');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:SofaScoreTask');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:SofaScoreTask');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,65 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\SofaScoreTournament;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class SofaScoreTournamentPolicy
|
class SofaScoreTournamentPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, SofaScoreTournament $sofaScoreTournament): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, SofaScoreTournament $sofaScoreTournament): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, SofaScoreTournament $sofaScoreTournament): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, SofaScoreTournament $sofaScoreTournament): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, SofaScoreTournament $sofaScoreTournament): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:SofaScoreTournament');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:SofaScoreTournament');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:SofaScoreTournament');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:SofaScoreTournament');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:SofaScoreTournament');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,66 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\StatisticFixtures;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class StatisticFixturesPolicy
|
class StatisticFixturesPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:StatisticFixtures');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, StatisticFixtures $statisticFixtures): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:StatisticFixtures');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:StatisticFixtures');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, StatisticFixtures $statisticFixtures): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:StatisticFixtures');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, StatisticFixtures $statisticFixtures): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:StatisticFixtures');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, StatisticFixtures $statisticFixtures): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:StatisticFixtures');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, StatisticFixtures $statisticFixtures): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:StatisticFixtures');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:StatisticFixtures');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:StatisticFixtures');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:StatisticFixtures');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:StatisticFixtures');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,66 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\StatistikoDetail;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class StatistikoDetailPolicy
|
class StatistikoDetailPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:StatistikoDetail');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, StatistikoDetail $statistikoDetail): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:StatistikoDetail');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:StatistikoDetail');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, StatistikoDetail $statistikoDetail): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:StatistikoDetail');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, StatistikoDetail $statistikoDetail): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:StatistikoDetail');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, StatistikoDetail $statistikoDetail): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:StatistikoDetail');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, StatistikoDetail $statistikoDetail): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:StatistikoDetail');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:StatistikoDetail');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:StatistikoDetail');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:StatistikoDetail');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:StatistikoDetail');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,66 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\StatistikoEvent;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class StatistikoEventPolicy
|
class StatistikoEventPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:StatistikoEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, StatistikoEvent $statistikoEvent): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:StatistikoEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:StatistikoEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, StatistikoEvent $statistikoEvent): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:StatistikoEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, StatistikoEvent $statistikoEvent): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:StatistikoEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, StatistikoEvent $statistikoEvent): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:StatistikoEvent');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, StatistikoEvent $statistikoEvent): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:StatistikoEvent');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:StatistikoEvent');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:StatistikoEvent');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:StatistikoEvent');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:StatistikoEvent');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,66 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\StatistikoImport;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class StatistikoImportPolicy
|
class StatistikoImportPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:StatistikoImport');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, StatistikoImport $statistikoImport): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:StatistikoImport');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:StatistikoImport');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, StatistikoImport $statistikoImport): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:StatistikoImport');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, StatistikoImport $statistikoImport): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:StatistikoImport');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, StatistikoImport $statistikoImport): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:StatistikoImport');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, StatistikoImport $statistikoImport): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:StatistikoImport');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:StatistikoImport');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:StatistikoImport');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:StatistikoImport');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:StatistikoImport');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,65 +2,66 @@
|
|||||||
|
|
||||||
namespace App\Policies;
|
namespace App\Policies;
|
||||||
|
|
||||||
use App\Models\StatistikoPlayer;
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
use App\Models\User;
|
use Illuminate\Foundation\Auth\User as AuthUser;
|
||||||
use Illuminate\Auth\Access\Response;
|
|
||||||
|
|
||||||
class StatistikoPlayerPolicy
|
class StatistikoPlayerPolicy
|
||||||
{
|
{
|
||||||
/**
|
use HandlesAuthorization;
|
||||||
* Determine whether the user can view any models.
|
|
||||||
*/
|
public function viewAny(AuthUser $authUser): bool
|
||||||
public function viewAny(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ViewAny:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function view(AuthUser $authUser): bool
|
||||||
* Determine whether the user can view the model.
|
|
||||||
*/
|
|
||||||
public function view(User $user, StatistikoPlayer $statistikoPlayer): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('View:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function create(AuthUser $authUser): bool
|
||||||
* Determine whether the user can create models.
|
|
||||||
*/
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Create:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function update(AuthUser $authUser): bool
|
||||||
* Determine whether the user can update the model.
|
|
||||||
*/
|
|
||||||
public function update(User $user, StatistikoPlayer $statistikoPlayer): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Update:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function delete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can delete the model.
|
|
||||||
*/
|
|
||||||
public function delete(User $user, StatistikoPlayer $statistikoPlayer): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Delete:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function restore(AuthUser $authUser): bool
|
||||||
* Determine whether the user can restore the model.
|
|
||||||
*/
|
|
||||||
public function restore(User $user, StatistikoPlayer $statistikoPlayer): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('Restore:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function forceDelete(AuthUser $authUser): bool
|
||||||
* Determine whether the user can permanently delete the model.
|
|
||||||
*/
|
|
||||||
public function forceDelete(User $user, StatistikoPlayer $statistikoPlayer): bool
|
|
||||||
{
|
{
|
||||||
return false;
|
return $authUser->can('ForceDelete:StatistikoPlayer');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function forceDeleteAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('ForceDeleteAny:StatistikoPlayer');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function restoreAny(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('RestoreAny:StatistikoPlayer');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function replicate(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Replicate:StatistikoPlayer');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reorder(AuthUser $authUser): bool
|
||||||
|
{
|
||||||
|
return $authUser->can('Reorder:StatistikoPlayer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,9 +13,13 @@ return new class extends Migration
|
|||||||
{
|
{
|
||||||
Schema::create('sofa_score_event_grappeds', function (Blueprint $table) {
|
Schema::create('sofa_score_event_grappeds', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->integer('event_id');
|
$table->string('name')->nullable();
|
||||||
$table->string('name');
|
$table->string('url')->nullable();
|
||||||
$table->dateTime('starttime')->nullable();
|
$table->dateTime('starttime')->nullable();
|
||||||
|
$table->boolean('got_statistics')->default(false);
|
||||||
|
$table->boolean('got_lineups')->default(false);
|
||||||
|
$table->boolean('got_odds')->default(false);
|
||||||
|
$table->boolean('got_incidents')->default(false);
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user