Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Application Laravel Package

joomla/application

Joomla Framework Application package providing AbstractApplication base classes for building apps. Includes lifecycle initialise hook, input/config handling, execute flow with doExecute(), response headers/body helpers, and PSR-3 LoggerAwareInterface support for integrating logging.

View on GitHub
Deep Wiki
Context7

Getting Started

Start by installing via Composer: composer require joomla/application "~3.0". Then create a basic application class extending AbstractApplication (for generic apps), AbstractWebApplication (for HTTP apps), or use the ready-made WebApplication for minimal web apps. Override initialise() for setup and doExecute() for core logic—this is where your app’s main behavior lives. The constructor should call parent::__construct() last, and always configure PSR-3 logging in initialise() using setLogger()/getLogger().

Implementation Patterns

  • Web apps: Extend AbstractWebApplication or use WebApplication directly; inject Input, Registry, and PSR-3 logger. Use setHeader(), setBody(), getBody() to manage responses. Leverage URI config (uri.request, uri.base.full, etc.) for route/media resolution.
  • CLI apps: Note: CLI classes were removed in v2 — migrate to joomla/console instead. For legacy/adjacent use, still rely on AbstractApplication but avoid built-in CLI helpers like <info> tags (those were in removed CLI classes).
  • Testing: Use Joomla\Application\Tests\Mocker to generate mocks for AbstractApplication, AbstractWebApplication, etc., with minimal method stubs. Customize mock behavior via mockWeb* helper methods in test classes.
  • Logging: Initialize PSR-3 logger in initialise() based on config; use hasLogger() for optional logging. Avoid direct logger access—always go through getLogger().

Gotchas and Tips

  • Breaking changes in v2: getBody() no longer has a toBody param; checkToken() now validates tokens (not just presence); $input property is now protected and accessed via getInput(); CLI classes moved to joomla/console. Update notes are essential for migration.
  • Session handling: Sessions are opt-in via SessionAwareWebApplicationInterface and trait—don’t assume they’re available by default.
  • Mocking pitfalls: The Mocker only mocks common read/write methods; complex logic may need manual mocking of doExecute() or DI injection. Don’t rely on mocked methods mimicking full behavior (e.g., header replace logic is simplified).
  • PHP version: Requires ≥7.2; for PHP 8.3/8.4 compatibility, ensure you’re on ≥3.0.1 (fixes deprecations in WebClient).
  • Extending core classes: If swapping PSR-7 response implementations (e.g., Symfony instead of Diactoros), override setHeader, getHeaders, setBody, etc., manually.
  • Configuration quirks: site_uri and media_uri must be fully qualified if set (e.g., https://example.com/) to avoid relative path issues; unset config values fall back to uri.base derived from request.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport