Back-end Helpers
Import helpers from Qore\Next\System\Helpers.
Use helpers where they remove repeated framework plumbing. Keep domain-specific behaviour in services, resources or actions so it stays easy to test.
Framework
qore(): returns the Qore singleton. Use it for resource registration and services.get_class_name($object): returns the short class name.get_user_json_resource_class()andget_auth_user_json_resource_class(): read configured JSON resource classes.
URLs and auth
frontend_url($path, $params = [], $useDomain = true): builds a frontend URL usingapp.frontend_urland Qore's optional frontend prefix.user(): returns the authenticatedApp\Models\Useror throwsAuthenticationException.admin_user()andadmin_role(): return the first user/role and cache the lookup for the request.login($user)andlogout($user = null): call the login/logout handlers configured onqore().
Formatting
to_string($value): converts scalars, enums, arrays,Arrayable,JsonSerializableand stringable objects to a readable string.get_php_upload_limit(): returns the lower ofupload_max_filesizeandpost_max_sizein bytes.bytes_presenter($bytes): formats bytes asB,KB,MB,GBorTB.apply_timezone($date): parses a date if needed and appliesconfig('app.timezone').