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