🆙 Fixed and no bugs anymore 🆙

This commit is contained in:
Remco
2026-01-07 20:01:53 +01:00
parent 6bf99066a5
commit 65ea6c167f
34 changed files with 63 additions and 63 deletions
@@ -53,6 +53,6 @@ class TwoFactorAuthenticatedSessionController extends Controller
'ip_current' => $request->ip(),
]);
return resolve(TwoFactorLoginResponse::class);
return app(TwoFactorLoginResponse::class);
}
}
@@ -120,7 +120,7 @@ class CreateNewUser implements CreatesNewUsers
'beta_code' => ['sometimes', 'string', new BetaCodeRule],
'terms' => ['required', 'accepted'],
'g-recaptcha-response' => ['sometimes', 'string', new GoogleRecaptchaRule],
'cf-turnstile-response' => [resolve(Turnstile::class)],
'cf-turnstile-response' => [app(Turnstile::class)],
];
$messages = [
@@ -11,6 +11,7 @@ use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\ValidationException;
use Laravel\Fortify\Events\TwoFactorAuthenticationChallenged;
use Laravel\Fortify\Fortify;
use Laravel\Fortify\LoginRateLimiter;
use Laravel\Fortify\TwoFactorAuthenticatable;
@@ -179,7 +180,7 @@ class RedirectIfTwoFactorAuthenticatable
}
if (setting('cloudflare_turnstile_enabled') !== '' && setting('cloudflare_turnstile_enabled') !== '0') {
$rules['cf-turnstile-response'] = ['required', resolve(Turnstile::class)];
$rules['cf-turnstile-response'] = ['required', app(Turnstile::class)];
}
$messages = [
+2 -2
View File
@@ -123,7 +123,7 @@ class BadgePage extends Page
return;
}
$badgeData = resolve(ExternalTextsParser::class)->getBadgeData($badgeCode);
$badgeData = app(ExternalTextsParser::class)->getBadgeData($badgeCode);
$this->badgeWasPreviouslyCreated = is_array($badgeData['nitro']) || is_array($badgeData['flash']);
if ($this->badgeWasPreviouslyCreated) {
@@ -202,7 +202,7 @@ class BadgePage extends Page
return;
}
$externalTextsParser = resolve(ExternalTextsParser::class);
$externalTextsParser = app(ExternalTextsParser::class);
if ((empty($this->data['nitro']) && $nitroEnabled) || (empty($this->data['flash']) && $flashEnabled)) {
Notification::make()
+1 -1
View File
@@ -56,7 +56,7 @@ class Login extends \Filament\Auth\Pages\Login
session()->regenerate();
return resolve(LoginResponse::class);
return app(LoginResponse::class);
}
protected function throwFailureValidationException(): never
@@ -55,7 +55,7 @@ class BadgeTextEditorResource extends Resource
#[\Override]
public static function table(Table $table): Table
{
$settingsService = resolve(SettingsService::class);
$settingsService = app(SettingsService::class);
$badgesPath = $settingsService->getOrDefault('badges_path', '/gamedata/c_images/album1584/');
return $table
@@ -10,7 +10,7 @@ class CustomQueryBuilder extends Builder
public function __construct()
{
// Call the parent constructor with a dummy query
parent::__construct(resolve('db')->query());
parent::__construct(app('db')->query());
}
#[\Override]
@@ -58,7 +58,7 @@ class EditUser extends EditRecord
$this->halt();
}
$rcon = resolve(RconService::class);
$rcon = app(RconService::class);
if (! $user->online) {
DB::transaction(function () use ($user, $data): void {
@@ -152,7 +152,7 @@ class EditUser extends EditRecord
return;
}
resolve(SendCurrency::class)->execute($user, $currencyType, -$currency->amount + $updatedCurrencyAmount);
app(SendCurrency::class)->execute($user, $currencyType, -$currency->amount + $updatedCurrencyAmount);
});
}
@@ -83,7 +83,7 @@ class BadgesRelationManager extends RelationManager
->persistent()
->send();
} else {
$rcon = resolve(RconService::class);
$rcon = app(RconService::class);
$data = $action->getFormData();
$rcon->sendSafelyFromDashboard('sendBadge', [$user, $data['badge_code']], 'RCON: Failed to send the badge');
@@ -119,7 +119,7 @@ class BadgesRelationManager extends RelationManager
->persistent()
->send();
} else {
$rcon = resolve(RconService::class);
$rcon = app(RconService::class);
$badge = $action instanceof DeleteAction
? $action->getRecord()?->badge_code
: $action->getRecords()->map(fn ($record) => $record->badge_code)->join(';');
+5 -6
View File
@@ -3,27 +3,27 @@
use App\Services\HousekeepingPermissionsService;
use App\Services\PermissionsService;
use App\Services\SettingsService;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Schema;
if (! function_exists('setting')) {
function setting(string $setting): string
{
return resolve(SettingsService::class)->getOrDefault($setting);
return app(SettingsService::class)->getOrDefault($setting);
}
}
if (! function_exists('hasPermission')) {
function hasPermission(string $permission): string
{
return resolve(PermissionsService::class)->getOrDefault($permission);
return app(PermissionsService::class)->getOrDefault($permission);
}
}
if (! function_exists('hasHousekeepingPermission')) {
function hasHousekeepingPermission(string $permission): string
{
return resolve(HousekeepingPermissionsService::class)->getOrDefault($permission);
return app(HousekeepingPermissionsService::class)->getOrDefault($permission);
}
}
@@ -43,7 +43,6 @@ if (! function_exists('findMigration')) {
return basename($filename);
}
}
return '';
}
}
@@ -74,4 +73,4 @@ if (! function_exists('dropForeignKeyIfExists')) {
}
}
}
}
}
@@ -135,7 +135,7 @@ class ShopController extends Controller
public function handleFurniture(array $furniture)
{
$sendFurniture = resolve(SendFurniture::class);
$sendFurniture = app(SendFurniture::class);
$sendFurniture->execute(Auth::user(), $furniture);
}
@@ -5,6 +5,7 @@ namespace App\Http\Controllers\User;
use App\Http\Controllers\Controller;
use App\Models\PasswordResetToken;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use Mail;
@@ -24,9 +24,10 @@ class LocalizationMiddleware
$countryCode = config('habbo.site.default_language');
// GEWIJZIGD: isset() werkt niet op Request::server() in PHP 8. Gebruik null !== in plaats daarvan.
if (\Illuminate\Support\Facades\Request::server('HTTP_CF_IPCOUNTRY') !== null) {
if (null !== \Illuminate\Support\Facades\Request::server('HTTP_CF_IPCOUNTRY')) {
$countryCode = strtolower((string) \Illuminate\Support\Facades\Request::server('HTTP_CF_IPCOUNTRY'));
} elseif (\Illuminate\Support\Facades\Request::server('HTTP_ACCEPT_LANGUAGE') !== null) {
}
elseif (null !== \Illuminate\Support\Facades\Request::server('HTTP_ACCEPT_LANGUAGE')) {
$countryCode = strtolower(substr((string) \Illuminate\Support\Facades\Request::server('HTTP_ACCEPT_LANGUAGE'), 0, 2));
}
@@ -46,4 +47,4 @@ class LocalizationMiddleware
return $next($request);
}
}
}
@@ -17,7 +17,7 @@ class AccountSettingsFormRequest extends FormRequest
'mail' => ['required', 'email', Rule::unique('users')->ignore($this->user()->id), new WebsiteWordfilterRule],
'motto' => ['nullable', 'string', 'max:127', new WebsiteWordfilterRule],
'g-recaptcha-response' => [new GoogleRecaptchaRule],
'cf-turnstile-response' => [resolve(Turnstile::class)],
'cf-turnstile-response' => [app(Turnstile::class)],
];
}
@@ -18,7 +18,7 @@ class PasswordSettingsFormRequest extends FormRequest
'current_password' => ['required', 'string', new CurrentPasswordRule],
'password' => $this->passwordRules(),
'g-recaptcha-response' => [new GoogleRecaptchaRule],
'cf-turnstile-response' => [resolve(Turnstile::class)],
'cf-turnstile-response' => [app(Turnstile::class)],
];
}
}
@@ -18,7 +18,7 @@ class RegisterFormRequest extends FormRequest
'password' => ['required', 'string', 'confirmed', 'min:8'],
'terms' => ['required', 'accepted'],
'g-recaptcha-response' => [new GoogleRecaptchaRule],
'cf-turnstile-response' => [resolve(Turnstile::class)],
'cf-turnstile-response' => [app(Turnstile::class)],
];
}
@@ -13,7 +13,7 @@ class ShopVoucherFormRequest extends FormRequest
return [
'code' => ['required', 'string'],
'g-recaptcha-response' => [new GoogleRecaptchaRule],
'cf-turnstile-response' => [resolve(Turnstile::class)],
'cf-turnstile-response' => [app(Turnstile::class)],
];
}
}
@@ -13,7 +13,7 @@ class StaffApplicationFormRequest extends FormRequest
return [
'content' => ['required', 'string'],
'g-recaptcha-response' => [new GoogleRecaptchaRule],
'cf-turnstile-response' => [resolve(Turnstile::class)],
'cf-turnstile-response' => [app(Turnstile::class)],
];
}
}
-1
View File
@@ -134,7 +134,6 @@ class Article extends Model
->each(fn (AuthorNotification $follower) => $follower->user->notify($this->user, NotificationType::ArticlePosted, $this->getNotificationUrl()),
);
}
protected function casts(): array
{
return [
-1
View File
@@ -22,7 +22,6 @@ class CommandLog extends Model
{
return $this->belongsTo(User::class);
}
protected function casts(): array
{
return [
@@ -45,7 +45,6 @@ class WebsiteOpenPosition extends Model
{
return $query->where('apply_from', '<=', now())->where('apply_to', '>', now());
}
protected function casts(): array
{
return [
@@ -52,6 +52,6 @@ class WebsiteHelpCenterTicket extends Model
protected function content(): \Illuminate\Database\Eloquent\Casts\Attribute
{
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: fn ($value) => Purify::clean($value));
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: fn($value) => Purify::clean($value));
}
}
@@ -29,6 +29,6 @@ class WebsiteHelpCenterTicketReply extends Model
protected function content(): \Illuminate\Database\Eloquent\Casts\Attribute
{
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: fn ($value) => Purify::clean($value));
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: fn($value) => Purify::clean($value));
}
}
@@ -4,6 +4,7 @@ namespace App\Models\Miscellaneous;
use App\Models\Room;
use App\Models\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
@@ -60,7 +61,6 @@ class CameraWeb extends Model
get: fn () => \Illuminate\Support\Facades\Date::parse($this->timestamp)->format('Y-m-d H:i'),
);
}
protected function casts(): array
{
return [
@@ -18,7 +18,6 @@ class PasswordResetToken extends Model
{
return $this->belongsTo(User::class, 'email', 'mail');
}
protected function casts(): array
{
return [
+1 -1
View File
@@ -245,7 +245,7 @@ class User extends Authenticatable implements FilamentUser, HasName
public function confirmTwoFactorAuthentication($code)
{
$codeIsValid = resolve(TwoFactorAuthenticationProvider::class)
$codeIsValid = app(TwoFactorAuthenticationProvider::class)
->verify(decrypt($this->two_factor_secret), $code);
if (! $codeIsValid) {
+2 -3
View File
@@ -20,12 +20,11 @@ class WebsiteAd extends Model
protected function imageUrl(): \Illuminate\Database\Eloquent\Casts\Attribute
{
return \Illuminate\Database\Eloquent\Casts\Attribute::make(get: function () {
$settingsService = resolve(SettingsService::class);
$settingsService = app(SettingsService::class);
$adsPicturePath = Cache::remember('ads_picture_path', 3600, fn () => $settingsService->getOrDefault('ads_picture_path'));
if (! str_starts_with((string) $adsPicturePath, 'http')) {
$adsPicturePath = rtrim((string) config('app.url'), '/') . '/' . ltrim((string) $adsPicturePath, '/');
}
return rtrim((string) $adsPicturePath, '/') . '/' . $this->image;
});
}
@@ -56,7 +55,7 @@ class WebsiteAd extends Model
protected function configureAdsDisk(): void
{
$settingsService = resolve(SettingsService::class);
$settingsService = app(SettingsService::class);
$adsPath = Cache::remember('ads_path_filesystem', 3600, fn () => $settingsService->getOrDefault('ads_path_filesystem'));
@@ -56,7 +56,7 @@ class AppServiceProvider extends ServiceProvider
$table->paginated([10, 25, 50]);
});
$settingsService = resolve(SettingsService::class);
$settingsService = app(SettingsService::class);
$badgePath = $settingsService->getOrDefault('badge_path_filesystem', '/var/www/gamedata/c_images/album1584');
Config::set('filesystems.disks.badges.root', $badgePath);
@@ -2,6 +2,7 @@
namespace App\Services\User;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
+2 -2
View File
@@ -22,7 +22,7 @@ return RectorConfig::configure()
->withSets([
LevelSetList::UP_TO_PHP_85,
// Dit activeert de gratis "Laravel Shift" naar versie 12:
LaravelLevelSetList::UP_TO_LARAVEL_120,
LaravelLevelSetList::UP_TO_LARAVEL_120,
LaravelSetList::LARAVEL_CODE_QUALITY,
SetList::CODE_QUALITY,
SetList::DEAD_CODE,
@@ -30,4 +30,4 @@ return RectorConfig::configure()
->withSkip([
__DIR__ . '/lang/vendor',
__DIR__ . '/storage', // Altijd overslaan
]);
]);
+2 -3
View File
@@ -1,9 +1,8 @@
import "./bootstrap";
import "./external/flowbite";
import 'swiper/css';
import 'swiper/css/pagination';
import "swiper/css";
import "swiper/css/pagination";
import Alpine from "alpinejs";
import Focus from "@alpinejs/focus";
@@ -1,17 +1,27 @@
import Swiper from 'swiper';
import { Autoplay, Pagination } from 'swiper/modules';
export default () => ({
const AtomSliders = {
init() {
const swiper = new Swiper('.swiper', {
modules: [Autoplay, Pagination],
autoplay: {
delay: 3000,
},
pagination: {
el: '.swiper-pagination',
},
// andere opties...
const swipers = document.querySelectorAll('.swiper');
swipers.forEach((swiperEl) => {
new Swiper(swiperEl, {
modules: [Autoplay, Pagination],
autoplay: {
delay: 3000,
disableOnInteraction: false,
},
pagination: {
el: '.swiper-pagination',
clickable: true,
},
loop: true,
slidesPerView: 1,
spaceBetween: 30,
});
});
}
});
};
export default AtomSliders;
@@ -49,7 +49,6 @@ export default defineConfig({
build: {
rollupOptions: {
onwarn(warning, warn) {
// Negeer INVALID_ANNOTATION warnings van flowbite
if (warning.code === 'INVALID_ANNOTATION') return;
warn(warning);
}
+1 -7
View File
@@ -2,10 +2,6 @@ import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";
import path from "path";
import tailwindcss from "tailwindcss";
import postcssImport from "postcss-import";
import postcssNesting from "postcss-nesting";
import tailwindcssNesting from "tailwindcss/nesting";
import autoprefixer from "autoprefixer";
export default defineConfig({
plugins: [
@@ -15,6 +11,7 @@ export default defineConfig({
"resources/js/global.js",
],
}),
{
name: "blade",
handleHotUpdate({ file, server }) {
@@ -35,12 +32,9 @@ export default defineConfig({
css: {
postcss: {
plugins: [
postcssImport(),
tailwindcssNesting(postcssNesting()),
tailwindcss({
config: path.resolve(__dirname, "tailwind.config.js"),
}),
autoprefixer(),
],
},
},