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;
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())
->setIsBroadcastingEnabled(config('broadcasting.default') === 'reverb')
->setIsExportingEnabledByDefault(false)
->setHasTableSettingsByDefault(false);
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.setFrontendUrlPrefix()is used byfrontend_url()and resource URL helpers.
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.
<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',
theme: ({ darkMode }) => ({
layout: { colorPrimary: darkMode ? '#60a5fa' : '#2563eb' }
})
}}
/>