Global Configuration
Global configuration belongs in AppServiceProvider::register().
Use this file for framework-wide behaviour that every request needs: resources, auth handlers, feature flags and frontend URL settings. Keep feature-specific setup close to the feature when it does not affect the whole application.
use function Qore\Next\System\Helpers\qore;
use Qore\Next\System\Node\SizeType;
qore()
->registerResource(new UserResource)
->setAuthMiddleware(['api', 'auth:sanctum'])
->setLoginHandler(fn (User $user) => Auth::guard('web')->login($user))
->setLogoutHandler(fn (?Model $model = null) => Auth::guard('web')->logout())
->setUserJsonResourceClass(UserJsonResource::class)
->setAuthUserJsonResourceClass(AuthUserJsonResource::class)
->setIsBroadcastingEnabled(config('broadcasting.default') === 'reverb')
->setIsExportingEnabledByDefault(false)
->setHasTableSettingsByDefault(false)
->setDefaultTableSize(SizeType::MIDDLE);
qore()
->fields()
->setIsAutofillEnabled(app()->isLocal());
Common options
registerResource()makes a resource available to routes, globals, menus and relation fields.setAuthMiddleware()defines the middleware used by Qore API routes.ApplyPreferencesis always appended.setLoginHandler()andsetLogoutHandler()let the application decide how sessions are created and destroyed.setUserDisplay()customizes how users are shown by user relation fields.isBearerTokenRequest()returns whether the current request contains anAuthorization: Bearer ...token. It is useful in application middleware when Sanctum token requests should stay stateless and follow a different flow than browser session requests, for example by skipping browser-only two-factor prompts or redirects.setIsBroadcastingEnabled(),setIsGlobalSearchEnabled()andsetIsNotificationsEnabled()toggle global features.setIsExportingEnabledByDefault()changes whether resource table exports are enabled by default.setHasTableSettingsByDefault()changes whether resource table settings are enabled by default.setDefaultTableSize()changes the default Ant Design table size. The framework default remainsSizeType::SMALL.setFrontendUrlPrefix()is used byfrontend_url()and resource URL helpers.setUserJsonResourceClass()andsetAuthUserJsonResourceClass()customize the JSON resources used for regular and authenticated user payloads.
Use qore()->fields()->setIsAutofillEnabled() to toggle generated default values for create forms. It is disabled by default.
Preference languages and locales
The language and regional format options shown on the preferences page are managed by qore()->locale().
qore()
->locale()
->setLanguages([
'nl' => 'Dutch',
'en' => 'English',
'fr' => 'French',
])
->setFormatLocales([
'nl-NL' => 'Dutch (Netherlands)',
'en-US' => 'English (United States)',
'en-GB' => 'English (United Kingdom)',
'fr-FR' => 'French (France)',
])
->setLanguageFormatLocales([
'nl' => 'nl-NL',
'en' => 'en-US',
'fr' => 'fr-FR',
]);
Labels may be literal text or translation keys.
Globals
Globals are app-wide values returned to the frontend: resources, modules, preferences, broadcasting status, global search status, notification status and unread notification count.
They exist so layout-level UI can render without every page repeating the same requests.
Frontend app config
Frontend configuration is passed to QoreAppProvider in resources/js/app.tsx.
Use it for SPA concerns: API client, router, layouts, i18n, default language, theme tokens and global API error handlers.
import enUS from 'antd/locale/en_US'
import frFR from 'antd/locale/fr_FR'
import nlNL from 'antd/locale/nl_NL'
<QoreAppProvider
app={{
apiEndpoint: import.meta.env.VITE_API_URL,
appTitle: import.meta.env.VITE_APP_NAME,
router,
api,
appLayout: QoreAppLayout,
guestLayout: GuestLayout,
authMiddleware,
i18n,
defaultLanguage: 'nl',
browserTitle: ({ title, appTitle }) =>
title ? `${title} | ${appTitle}` : appTitle,
supportedLanguages: ['nl', 'en', 'fr'],
supportedLocales: ['nl-NL', 'en-US', 'en-GB', 'fr-FR'],
languageLocales: {
nl: 'nl-NL',
en: 'en-US',
fr: 'fr-FR'
},
antLocales: {
nl: nlNL,
en: enUS,
fr: frFR
},
theme: ({ darkMode }) => ({
layout: { colorPrimary: darkMode ? '#60a5fa' : '#2563eb' }
})
}}
/>
browserTitle may also be a literal string when the tab title should never depend on the current page.
supportedLanguages, supportedLocales and languageLocales should mirror qore()->locale(). antLocales is optional; Qore falls back to Dutch for nl and English for other languages when no Ant Design locale is provided.