diff --git a/Updated_Cms/app/Filament/Traits/TranslatableResource.php b/Updated_Cms/app/Filament/Traits/TranslatableResource.php index 8d6399702e..b508c8a3f6 100644 --- a/Updated_Cms/app/Filament/Traits/TranslatableResource.php +++ b/Updated_Cms/app/Filament/Traits/TranslatableResource.php @@ -2,38 +2,46 @@ namespace App\Filament\Traits; -use Str; +use Illuminate\Support\Str; trait TranslatableResource { public static function getNavigationGroup(): ?string { + $group = property_exists(static::class, 'navigationGroup') ? static::$navigationGroup : null; + $groupStr = is_string($group) ? $group : ($group instanceof \UnitEnum ? $group->name : ''); return __( - sprintf('filament::resources.navigations.%s', static::$navigationGroup), + sprintf('filament::resources.navigations.%s', $groupStr), ); } public static function getPluralModelLabel(): string { + $identifier = property_exists(static::class, 'translateIdentifier') ? static::$translateIdentifier : ''; + $identifierStr = is_string($identifier) ? $identifier : ($identifier instanceof \UnitEnum ? $identifier->name : ''); return __(sprintf( Str::endsWith(static::class, 'RelationManager') ? 'filament::resources.resources.%s.navigation_label' : 'filament::resources.resources.%s.plural', - static::$translateIdentifier, + $identifierStr, )); } public static function getNavigationLabel(): string { + $identifier = property_exists(static::class, 'translateIdentifier') ? static::$translateIdentifier : ''; + $identifierStr = is_string($identifier) ? $identifier : ($identifier instanceof \UnitEnum ? $identifier->name : ''); return __( - sprintf('filament::resources.resources.%s.navigation_label', static::$translateIdentifier), + sprintf('filament::resources.resources.%s.navigation_label', $identifierStr), ); } public static function getModelLabel(): string { + $identifier = property_exists(static::class, 'translateIdentifier') ? static::$translateIdentifier : ''; + $identifierStr = is_string($identifier) ? $identifier : ($identifier instanceof \UnitEnum ? $identifier->name : ''); return __( - sprintf('filament::resources.resources.%s.label', static::$translateIdentifier), + sprintf('filament::resources.resources.%s.label', $identifierStr), ); } } diff --git a/Updated_Cms/app/Filament/Widgets/ArticlesAggregateChart.php b/Updated_Cms/app/Filament/Widgets/ArticlesAggregateChart.php index 90ad5b135e..c756bb0772 100644 --- a/Updated_Cms/app/Filament/Widgets/ArticlesAggregateChart.php +++ b/Updated_Cms/app/Filament/Widgets/ArticlesAggregateChart.php @@ -45,10 +45,10 @@ class ArticlesAggregateChart extends ChartWidget 'datasets' => [ [ 'label' => $label, - 'data' => $data->map(fn (TrendValue $value) => $value->aggregate), + 'data' => $data->map(fn ($value) => data_get($value, 'aggregate')), ], ], - 'labels' => $data->map(fn (TrendValue $value) => $value->date), + 'labels' => $data->map(fn ($value) => data_get($value, 'date')), ]; } diff --git a/Updated_Cms/app/Filament/Widgets/TopDashboardOverview.php b/Updated_Cms/app/Filament/Widgets/TopDashboardOverview.php index d99588799e..c7e0c5c71d 100644 --- a/Updated_Cms/app/Filament/Widgets/TopDashboardOverview.php +++ b/Updated_Cms/app/Filament/Widgets/TopDashboardOverview.php @@ -20,31 +20,31 @@ class TopDashboardOverview extends BaseWidget protected function getStats(): array { return [ - Stat::make(__('filament::resources.stats.users_count.title'), Number::format(User::count(), '0', '1', app()->getLocale())) + Stat::make(__('filament::resources.stats.users_count.title'), Number::format(User::count(), 0, 1, app()->getLocale())) ->description(__('filament::resources.stats.users_count.description')) ->chart([20, 20]) ->descriptionIcon('heroicon-m-user-group', IconPosition::Before) ->color('success'), - Stat::make(__('filament::resources.stats.furniture_count.title'), Number::format(ItemDefinition::count(), '0', '1', app()->getLocale())) + Stat::make(__('filament::resources.stats.furniture_count.title'), Number::format(ItemDefinition::count(), 0, 1, app()->getLocale())) ->description(__('filament::resources.stats.furniture_count.description')) ->descriptionIcon('heroicon-m-cube', IconPosition::Before) ->chart([20, 20]) ->color('success'), - Stat::make(__('filament::resources.stats.rooms_count.title'), Number::format(Room::count(), '0', '1', app()->getLocale())) + Stat::make(__('filament::resources.stats.rooms_count.title'), Number::format(Room::count(), 0, 1, app()->getLocale())) ->description(__('filament::resources.stats.rooms_count.description')) ->descriptionIcon('heroicon-m-building-storefront', IconPosition::Before) ->chart([20, 20]) ->color('success'), - Stat::make(__('filament::resources.stats.photos_count.title'), Number::format(CameraWeb::count(), '0', '1', app()->getLocale())) + Stat::make(__('filament::resources.stats.photos_count.title'), Number::format(CameraWeb::count(), 0, 1, app()->getLocale())) ->description(__('filament::resources.stats.photos_count.description')) ->descriptionIcon('heroicon-m-camera', IconPosition::Before) ->chart([20, 20]) ->color('success'), - Stat::make(__('filament::resources.stats.badge_count.title'), Number::format(WebsiteBadge::count(), '0', '1', app()->getLocale())) + Stat::make(__('filament::resources.stats.badge_count.title'), Number::format(WebsiteBadge::count(), 0, 1, app()->getLocale())) ->description(__('filament::resources.stats.badge_count.description')) ->descriptionIcon('heroicon-m-gif', IconPosition::Before) ->chart([20, 20]) diff --git a/Updated_Cms/app/Helpers/helper.php b/Updated_Cms/app/Helpers/helper.php index 8b32ee4ce5..9be18ba3cb 100644 --- a/Updated_Cms/app/Helpers/helper.php +++ b/Updated_Cms/app/Helpers/helper.php @@ -35,16 +35,14 @@ if (! function_exists('isDarkColor')) { if (! function_exists('hasPermission')) { function hasPermission(string $permission): bool { - $value = app(PermissionsService::class)->getOrDefault($permission); - return $value === true || $value === 1 || $value === '1'; + return app(PermissionsService::class)->getOrDefault($permission); } } if (! function_exists('hasHousekeepingPermission')) { function hasHousekeepingPermission(string $permission): bool { - $value = app(HousekeepingPermissionsService::class)->getOrDefault($permission); - return $value === true || $value === 1 || $value === '1'; + return app(HousekeepingPermissionsService::class)->getOrDefault($permission); } } @@ -59,9 +57,11 @@ if (! function_exists('findMigration')) { function findMigration(string $tableName): string { static $cache = []; + $cache = is_array($cache) ? $cache : []; if (isset($cache[$tableName])) { - return $cache[$tableName]; + $cached = $cache[$tableName]; + return is_string($cached) ? $cached : ''; } $migrationsPath = database_path('migrations'); @@ -75,8 +75,9 @@ if (! function_exists('findMigration')) { if ($file->isFile() && $file->getExtension() === 'php') { $content = @file_get_contents($file->getPathname()); if ($content !== false && str_contains($content, "Schema::create('$tableName'")) { - $cache[$tableName] = $file->getFilename(); - return $file->getFilename(); + $filename = (string) $file->getFilename(); + $cache[$tableName] = $filename; + return $filename; } } } @@ -110,8 +111,8 @@ if (! function_exists('dropForeignKeyIfExists')) { ->pluck('CONSTRAINT_NAME'); foreach ($foreignKeys as $foreignKey) { - if (! empty($foreignKey)) { - $connection->statement("ALTER TABLE {$table} DROP FOREIGN KEY {$foreignKey}"); + if (is_string($foreignKey) && $foreignKey !== '') { + $connection->statement('ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey); } } } diff --git a/Updated_Cms/app/Models/User.php b/Updated_Cms/app/Models/User.php index 78f1d44628..ffb0b38a7e 100644 --- a/Updated_Cms/app/Models/User.php +++ b/Updated_Cms/app/Models/User.php @@ -72,7 +72,6 @@ use App\Models\ChatlogPrivate; */ class User extends Authenticatable implements FilamentUser, HasName { - /** @use HasFactory<\Database\Factories\UserFactory> */ use HasApiTokens, HasFactory, LogsActivity, Notifiable, TwoFactorAuthenticatable; public $timestamps = false; @@ -311,6 +310,11 @@ class User extends Authenticatable implements FilamentUser, HasName return $this->hasMany(CameraWeb::class); } + protected static function newFactory(): \Database\Factories\UserFactory + { + return \Database\Factories\UserFactory::new(); + } + /** * @return HasMany */ diff --git a/Updated_Cms/config/cache.php b/Updated_Cms/config/cache.php index daf5e68be5..d4454c0efb 100644 --- a/Updated_Cms/config/cache.php +++ b/Updated_Cms/config/cache.php @@ -105,6 +105,6 @@ return [ | */ - 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'), + 'prefix' => env('CACHE_PREFIX', Str::slug((string) env('APP_NAME', 'laravel'), '_') . '_cache_'), ]; diff --git a/Updated_Cms/config/database.php b/Updated_Cms/config/database.php index d93e414ec4..8a230f5057 100644 --- a/Updated_Cms/config/database.php +++ b/Updated_Cms/config/database.php @@ -142,7 +142,7 @@ return [ 'options' => [ 'cluster' => env('REDIS_CLUSTER', 'redis'), - 'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'), + 'prefix' => env('REDIS_PREFIX', Str::slug((string) env('APP_NAME', 'laravel'), '_') . '_database_'), ], 'default' => [ diff --git a/Updated_Cms/config/session.php b/Updated_Cms/config/session.php index 5fb15f8974..a205274421 100644 --- a/Updated_Cms/config/session.php +++ b/Updated_Cms/config/session.php @@ -128,7 +128,7 @@ return [ 'cookie' => env( 'SESSION_COOKIE', - Str::slug(env('APP_NAME', 'laravel'), '_') . '_session', + Str::slug((string) env('APP_NAME', 'laravel'), '_') . '_session', ), /* diff --git a/Updated_Cms/database/factories/UserFactory.php b/Updated_Cms/database/factories/UserFactory.php index ca0158100d..af820fdbec 100644 --- a/Updated_Cms/database/factories/UserFactory.php +++ b/Updated_Cms/database/factories/UserFactory.php @@ -2,11 +2,15 @@ namespace Database\Factories; +use App\Models\User; use Illuminate\Database\Eloquent\Factories\Factory; use Illuminate\Support\Facades\Hash; -class UserFactory extends Factory +class UserFactory extends Factory { + /** @var class-string */ + protected $model = User::class; + public function definition(): array { return [ diff --git a/Updated_Cms/storage/logs/laravel.log b/Updated_Cms/storage/logs/laravel.log index 877041f203..8df0409af1 100644 --- a/Updated_Cms/storage/logs/laravel.log +++ b/Updated_Cms/storage/logs/laravel.log @@ -61,3 +61,9 @@ [2026-01-19 21:12:03] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd [2026-01-19 21:30:09] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd [2026-01-19 21:30:09] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd +[2026-01-19 21:37:29] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd +[2026-01-19 21:37:29] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd +[2026-01-19 22:12:15] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd +[2026-01-19 22:12:15] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd +[2026-01-19 22:18:51] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd +[2026-01-19 22:18:53] production.ERROR: RCON connection failed: Kan geen verbinding maken omdat de doelcomputer de verbinding actief heeft geweigerd