This commit is contained in:
salam committed 2026-10-08 15:33:05 +02:00
1 parent 29018914d1
commit 8cb1d428cb
17 files changed
+196 -147

No files matched your search

@@ -2,8 +2,6 @@
namespace App\Filament\Clusters\StaticData\Resources\SofaScoreCategories;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\CreateSofaScoreCategory;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\EditSofaScoreCategory;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Pages\ListSofaScoreCategories;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Schemas\SofaScoreCategoryForm;
use App\Filament\Clusters\StaticData\Resources\SofaScoreCategories\Tables\SofaScoreCategoriesTable;
@@ -23,11 +21,12 @@ class SofaScoreCategoryResource extends Resource
protected static ?int $navigationSort = 13;
protected static string|UnitEnum|null $navigationGroup = 'Statistiko';
protected static ?string $recordTitleAttribute = 'SS Countries';
protected static ?string $navigationLabel = 'SS Countries';
protected static ?string $recordTitleAttribute = 'Countries';
protected static ?string $modelLabel = 'SS Countries';
protected static ?string $navigationLabel = 'Countries';
protected static ?string $modelLabel = 'Countries';
public static function form(Schema $schema): Schema
{
@@ -20,9 +20,9 @@ class StatistikoConfigResource extends Resource
protected static ?string $cluster = StaticDataCluster::class;
protected static ?string $navigationLabel = 'Configurations';
protected static ?string $navigationLabel = 'Aspettativa';
protected static ?string $modelLabel = 'Configurations';
protected static ?string $modelLabel = 'Aspettativa';
protected static ?int $navigationSort = 15;
@@ -42,6 +42,7 @@ class StatistikoConfigResource extends Resource
'index' => ListStatistikoConfigs::route('/'),
];
}
public static function getNavigationBadge(): ?string
{
return parent::getEloquentQuery()->count();
@@ -14,7 +14,7 @@ class StatistikoConfigsTable
{
return $table
->columns([
TextColumn::make('group')->formatStateUsing(fn(string $state): string => match ($state) {
TextColumn::make('group')->formatStateUsing(fn (string $state): string => match ($state) {
'gls' => 'Goals',
'crn' => 'Corner',
'fls' => 'Fouls',
@@ -22,20 +22,28 @@ class StatistikoConfigsTable
'crd' => 'Cards',
'snt' => 'Shots On Target',
'tsh' => 'Total Shots',
'all' => 'Method B',
}),
TextColumn::make('team')->badge()
->color(fn(string $state): string => match ($state) {
->color(fn (string $state): string => match ($state) {
'home' => 'info',
'away' => 'warning',
}),
TextColumn::make('varname')
->formatStateUsing(fn(string $state): string => strtoupper($state)),
->formatStateUsing(fn (string $state): string => strtoupper($state)),
TextInputColumn::make('value')
->prefix('xx.x')
->type('number')
->rules(['required', 'decimal:0.1,10']),
])
->filters([
SelectFilter::make('type')
->label('Calculation')
->default('B')
->options([
'A' => 'Type A',
'B' => 'Type B',
]),
SelectFilter::make('group')
->options([
'gls' => 'Goals',
@@ -50,7 +58,7 @@ class StatistikoConfigsTable
->options([
'home' => 'Home',
'away' => 'Away',
])
]),
], layout: FiltersLayout::AboveContent)
->deferFilters(false);
}
@@ -16,6 +16,10 @@ class StatistikoDetailResource extends Resource
{
protected static ?string $model = StatistikoDetail::class;
protected static bool $shouldSkipAuthorization = true;
protected static bool $shouldRegisterNavigation = true;
protected static ?string $navigationLabel = 'Details';
protected static ?string $modelLabel = 'Details';
@@ -44,6 +44,7 @@ class ExpectationCalculation
}
}
$asp_result = [];
foreach ($summen2 as $bettype => $value) {
$asp_result[$bettype]['home'] = round($value['home']['sum'] / $value['home']['cnt'], 1);
$asp_result[$bettype]['away'] = round($value['away']['sum'] / $value['away']['cnt'], 1);
@@ -95,7 +95,7 @@ class LoadEventsQuery
* STATTISTIC DATA
*/
// dd($team_id, $home_id, $away_id);
Log::debug('res', [$team_id, $league_id, $season]);
// Log::debug('res', [$team_id, $league_id, $season]);
$res = StatistikoEvent::where(function ($query) use ($league_id, $similar_past_matches) {
switch ($similar_past_matches) {
+41 -37
View File
@@ -1,66 +1,70 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\SofaScoreCategory;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
class SofaScoreCategoryPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:SofaScoreCategory');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, SofaScoreCategory $sofaScoreCategory): bool
public function view(AuthUser $authUser, SofaScoreCategory $sofaScoreCategory): bool
{
return false;
return $authUser->can('View:SofaScoreCategory');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:SofaScoreCategory');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, SofaScoreCategory $sofaScoreCategory): bool
public function update(AuthUser $authUser, SofaScoreCategory $sofaScoreCategory): bool
{
return false;
return $authUser->can('Update:SofaScoreCategory');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, SofaScoreCategory $sofaScoreCategory): bool
public function delete(AuthUser $authUser, SofaScoreCategory $sofaScoreCategory): bool
{
return false;
return $authUser->can('Delete:SofaScoreCategory');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, SofaScoreCategory $sofaScoreCategory): bool
public function restore(AuthUser $authUser, SofaScoreCategory $sofaScoreCategory): bool
{
return false;
return $authUser->can('Restore:SofaScoreCategory');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, SofaScoreCategory $sofaScoreCategory): bool
public function forceDelete(AuthUser $authUser, SofaScoreCategory $sofaScoreCategory): bool
{
return false;
return $authUser->can('ForceDelete:SofaScoreCategory');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:SofaScoreCategory');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:SofaScoreCategory');
}
public function replicate(AuthUser $authUser, SofaScoreCategory $sofaScoreCategory): bool
{
return $authUser->can('Replicate:SofaScoreCategory');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:SofaScoreCategory');
}
}
+11 -7
View File
@@ -1,9 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\SofaScoreRosa;
use Illuminate\Auth\Access\HandlesAuthorization;
class SofaScoreRosaPolicy
{
@@ -14,7 +17,7 @@ class SofaScoreRosaPolicy
return $authUser->can('ViewAny:SofaScoreRosa');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, SofaScoreRosa $sofaScoreRosa): bool
{
return $authUser->can('View:SofaScoreRosa');
}
@@ -24,22 +27,22 @@ class SofaScoreRosaPolicy
return $authUser->can('Create:SofaScoreRosa');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, SofaScoreRosa $sofaScoreRosa): bool
{
return $authUser->can('Update:SofaScoreRosa');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, SofaScoreRosa $sofaScoreRosa): bool
{
return $authUser->can('Delete:SofaScoreRosa');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, SofaScoreRosa $sofaScoreRosa): bool
{
return $authUser->can('Restore:SofaScoreRosa');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, SofaScoreRosa $sofaScoreRosa): bool
{
return $authUser->can('ForceDelete:SofaScoreRosa');
}
@@ -54,7 +57,7 @@ class SofaScoreRosaPolicy
return $authUser->can('RestoreAny:SofaScoreRosa');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, SofaScoreRosa $sofaScoreRosa): bool
{
return $authUser->can('Replicate:SofaScoreRosa');
}
@@ -63,4 +66,5 @@ class SofaScoreRosaPolicy
{
return $authUser->can('Reorder:SofaScoreRosa');
}
}
+11 -7
View File
@@ -1,9 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\SofaScoreTask;
use Illuminate\Auth\Access\HandlesAuthorization;
class SofaScoreTaskPolicy
{
@@ -14,7 +17,7 @@ class SofaScoreTaskPolicy
return $authUser->can('ViewAny:SofaScoreTask');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, SofaScoreTask $sofaScoreTask): bool
{
return $authUser->can('View:SofaScoreTask');
}
@@ -24,22 +27,22 @@ class SofaScoreTaskPolicy
return $authUser->can('Create:SofaScoreTask');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, SofaScoreTask $sofaScoreTask): bool
{
return $authUser->can('Update:SofaScoreTask');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, SofaScoreTask $sofaScoreTask): bool
{
return $authUser->can('Delete:SofaScoreTask');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, SofaScoreTask $sofaScoreTask): bool
{
return $authUser->can('Restore:SofaScoreTask');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, SofaScoreTask $sofaScoreTask): bool
{
return $authUser->can('ForceDelete:SofaScoreTask');
}
@@ -54,7 +57,7 @@ class SofaScoreTaskPolicy
return $authUser->can('RestoreAny:SofaScoreTask');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, SofaScoreTask $sofaScoreTask): bool
{
return $authUser->can('Replicate:SofaScoreTask');
}
@@ -63,4 +66,5 @@ class SofaScoreTaskPolicy
{
return $authUser->can('Reorder:SofaScoreTask');
}
}
+11 -7
View File
@@ -1,9 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\SofaScoreTournament;
use Illuminate\Auth\Access\HandlesAuthorization;
class SofaScoreTournamentPolicy
{
@@ -14,7 +17,7 @@ class SofaScoreTournamentPolicy
return $authUser->can('ViewAny:SofaScoreTournament');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, SofaScoreTournament $sofaScoreTournament): bool
{
return $authUser->can('View:SofaScoreTournament');
}
@@ -24,22 +27,22 @@ class SofaScoreTournamentPolicy
return $authUser->can('Create:SofaScoreTournament');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, SofaScoreTournament $sofaScoreTournament): bool
{
return $authUser->can('Update:SofaScoreTournament');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, SofaScoreTournament $sofaScoreTournament): bool
{
return $authUser->can('Delete:SofaScoreTournament');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, SofaScoreTournament $sofaScoreTournament): bool
{
return $authUser->can('Restore:SofaScoreTournament');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, SofaScoreTournament $sofaScoreTournament): bool
{
return $authUser->can('ForceDelete:SofaScoreTournament');
}
@@ -54,7 +57,7 @@ class SofaScoreTournamentPolicy
return $authUser->can('RestoreAny:SofaScoreTournament');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, SofaScoreTournament $sofaScoreTournament): bool
{
return $authUser->can('Replicate:SofaScoreTournament');
}
@@ -63,4 +66,5 @@ class SofaScoreTournamentPolicy
{
return $authUser->can('Reorder:SofaScoreTournament');
}
}
+11 -8
View File
@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\StatisticFixtures;
use Illuminate\Auth\Access\HandlesAuthorization;
class StatisticFixturesPolicy
{
@@ -15,7 +17,7 @@ class StatisticFixturesPolicy
return $authUser->can('ViewAny:StatisticFixtures');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, StatisticFixtures $statisticFixtures): bool
{
return $authUser->can('View:StatisticFixtures');
}
@@ -25,22 +27,22 @@ class StatisticFixturesPolicy
return $authUser->can('Create:StatisticFixtures');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, StatisticFixtures $statisticFixtures): bool
{
return $authUser->can('Update:StatisticFixtures');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, StatisticFixtures $statisticFixtures): bool
{
return $authUser->can('Delete:StatisticFixtures');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, StatisticFixtures $statisticFixtures): bool
{
return $authUser->can('Restore:StatisticFixtures');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, StatisticFixtures $statisticFixtures): bool
{
return $authUser->can('ForceDelete:StatisticFixtures');
}
@@ -55,7 +57,7 @@ class StatisticFixturesPolicy
return $authUser->can('RestoreAny:StatisticFixtures');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, StatisticFixtures $statisticFixtures): bool
{
return $authUser->can('Replicate:StatisticFixtures');
}
@@ -64,4 +66,5 @@ class StatisticFixturesPolicy
{
return $authUser->can('Reorder:StatisticFixtures');
}
}
+41 -37
View File
@@ -1,66 +1,70 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\StatistikoConfig;
use App\Models\User;
use Illuminate\Auth\Access\Response;
use Illuminate\Auth\Access\HandlesAuthorization;
class StatistikoConfigPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
use HandlesAuthorization;
public function viewAny(AuthUser $authUser): bool
{
return false;
return $authUser->can('ViewAny:StatistikoConfig');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, StatistikoConfig $statistikoConfig): bool
public function view(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
{
return false;
return $authUser->can('View:StatistikoConfig');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
public function create(AuthUser $authUser): bool
{
return false;
return $authUser->can('Create:StatistikoConfig');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, StatistikoConfig $statistikoConfig): bool
public function update(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
{
return false;
return $authUser->can('Update:StatistikoConfig');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, StatistikoConfig $statistikoConfig): bool
public function delete(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
{
return false;
return $authUser->can('Delete:StatistikoConfig');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, StatistikoConfig $statistikoConfig): bool
public function restore(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
{
return false;
return $authUser->can('Restore:StatistikoConfig');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, StatistikoConfig $statistikoConfig): bool
public function forceDelete(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
{
return false;
return $authUser->can('ForceDelete:StatistikoConfig');
}
public function forceDeleteAny(AuthUser $authUser): bool
{
return $authUser->can('ForceDeleteAny:StatistikoConfig');
}
public function restoreAny(AuthUser $authUser): bool
{
return $authUser->can('RestoreAny:StatistikoConfig');
}
public function replicate(AuthUser $authUser, StatistikoConfig $statistikoConfig): bool
{
return $authUser->can('Replicate:StatistikoConfig');
}
public function reorder(AuthUser $authUser): bool
{
return $authUser->can('Reorder:StatistikoConfig');
}
}
+11 -8
View File
@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\StatistikoDetail;
use Illuminate\Auth\Access\HandlesAuthorization;
class StatistikoDetailPolicy
{
@@ -15,7 +17,7 @@ class StatistikoDetailPolicy
return $authUser->can('ViewAny:StatistikoDetail');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, StatistikoDetail $statistikoDetail): bool
{
return $authUser->can('View:StatistikoDetail');
}
@@ -25,22 +27,22 @@ class StatistikoDetailPolicy
return $authUser->can('Create:StatistikoDetail');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, StatistikoDetail $statistikoDetail): bool
{
return $authUser->can('Update:StatistikoDetail');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, StatistikoDetail $statistikoDetail): bool
{
return $authUser->can('Delete:StatistikoDetail');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, StatistikoDetail $statistikoDetail): bool
{
return $authUser->can('Restore:StatistikoDetail');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, StatistikoDetail $statistikoDetail): bool
{
return $authUser->can('ForceDelete:StatistikoDetail');
}
@@ -55,7 +57,7 @@ class StatistikoDetailPolicy
return $authUser->can('RestoreAny:StatistikoDetail');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, StatistikoDetail $statistikoDetail): bool
{
return $authUser->can('Replicate:StatistikoDetail');
}
@@ -64,4 +66,5 @@ class StatistikoDetailPolicy
{
return $authUser->can('Reorder:StatistikoDetail');
}
}
+11 -8
View File
@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\StatistikoEvent;
use Illuminate\Auth\Access\HandlesAuthorization;
class StatistikoEventPolicy
{
@@ -15,7 +17,7 @@ class StatistikoEventPolicy
return $authUser->can('ViewAny:StatistikoEvent');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, StatistikoEvent $statistikoEvent): bool
{
return $authUser->can('View:StatistikoEvent');
}
@@ -25,22 +27,22 @@ class StatistikoEventPolicy
return $authUser->can('Create:StatistikoEvent');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, StatistikoEvent $statistikoEvent): bool
{
return $authUser->can('Update:StatistikoEvent');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, StatistikoEvent $statistikoEvent): bool
{
return $authUser->can('Delete:StatistikoEvent');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, StatistikoEvent $statistikoEvent): bool
{
return $authUser->can('Restore:StatistikoEvent');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, StatistikoEvent $statistikoEvent): bool
{
return $authUser->can('ForceDelete:StatistikoEvent');
}
@@ -55,7 +57,7 @@ class StatistikoEventPolicy
return $authUser->can('RestoreAny:StatistikoEvent');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, StatistikoEvent $statistikoEvent): bool
{
return $authUser->can('Replicate:StatistikoEvent');
}
@@ -64,4 +66,5 @@ class StatistikoEventPolicy
{
return $authUser->can('Reorder:StatistikoEvent');
}
}
+11 -8
View File
@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\StatistikoImport;
use Illuminate\Auth\Access\HandlesAuthorization;
class StatistikoImportPolicy
{
@@ -15,7 +17,7 @@ class StatistikoImportPolicy
return $authUser->can('ViewAny:StatistikoImport');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, StatistikoImport $statistikoImport): bool
{
return $authUser->can('View:StatistikoImport');
}
@@ -25,22 +27,22 @@ class StatistikoImportPolicy
return $authUser->can('Create:StatistikoImport');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, StatistikoImport $statistikoImport): bool
{
return $authUser->can('Update:StatistikoImport');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, StatistikoImport $statistikoImport): bool
{
return $authUser->can('Delete:StatistikoImport');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, StatistikoImport $statistikoImport): bool
{
return $authUser->can('Restore:StatistikoImport');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, StatistikoImport $statistikoImport): bool
{
return $authUser->can('ForceDelete:StatistikoImport');
}
@@ -55,7 +57,7 @@ class StatistikoImportPolicy
return $authUser->can('RestoreAny:StatistikoImport');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, StatistikoImport $statistikoImport): bool
{
return $authUser->can('Replicate:StatistikoImport');
}
@@ -64,4 +66,5 @@ class StatistikoImportPolicy
{
return $authUser->can('Reorder:StatistikoImport');
}
}
+11 -8
View File
@@ -1,10 +1,12 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Illuminate\Foundation\Auth\User as AuthUser;
use App\Models\StatistikoPlayer;
use Illuminate\Auth\Access\HandlesAuthorization;
class StatistikoPlayerPolicy
{
@@ -15,7 +17,7 @@ class StatistikoPlayerPolicy
return $authUser->can('ViewAny:StatistikoPlayer');
}
public function view(AuthUser $authUser): bool
public function view(AuthUser $authUser, StatistikoPlayer $statistikoPlayer): bool
{
return $authUser->can('View:StatistikoPlayer');
}
@@ -25,22 +27,22 @@ class StatistikoPlayerPolicy
return $authUser->can('Create:StatistikoPlayer');
}
public function update(AuthUser $authUser): bool
public function update(AuthUser $authUser, StatistikoPlayer $statistikoPlayer): bool
{
return $authUser->can('Update:StatistikoPlayer');
}
public function delete(AuthUser $authUser): bool
public function delete(AuthUser $authUser, StatistikoPlayer $statistikoPlayer): bool
{
return $authUser->can('Delete:StatistikoPlayer');
}
public function restore(AuthUser $authUser): bool
public function restore(AuthUser $authUser, StatistikoPlayer $statistikoPlayer): bool
{
return $authUser->can('Restore:StatistikoPlayer');
}
public function forceDelete(AuthUser $authUser): bool
public function forceDelete(AuthUser $authUser, StatistikoPlayer $statistikoPlayer): bool
{
return $authUser->can('ForceDelete:StatistikoPlayer');
}
@@ -55,7 +57,7 @@ class StatistikoPlayerPolicy
return $authUser->can('RestoreAny:StatistikoPlayer');
}
public function replicate(AuthUser $authUser): bool
public function replicate(AuthUser $authUser, StatistikoPlayer $statistikoPlayer): bool
{
return $authUser->can('Replicate:StatistikoPlayer');
}
@@ -64,4 +66,5 @@ class StatistikoPlayerPolicy
{
return $authUser->can('Reorder:StatistikoPlayer');
}
}
@@ -13,6 +13,7 @@ return new class extends Migration
{
Schema::create('statistiko_configs', function (Blueprint $table) {
$table->id();
$table->string('type');
$table->string('group');
$table->string('team');
$table->string('varname');