Weave 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

Statamic Asset Collector Laravel Package

alpshq/statamic-asset-collector

A Statamic addon for gathering front-end assets in your templates. Asset Collector lets you collect CSS and JavaScript references from Antlers views and output them together, keeping asset handling organized across layouts and partials.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Confirm your application is on Statamic 4 (or verify whether v1.0.1 still supports Statamic 3) and a compatible Laravel version. Check the package’s composer.json for exact constraints.
  • Install the package: composer require vendor/package:^1.0 (replace with the actual package name).
  • Publish any config or assets if the package provides them: php artisan vendor:publish --provider="Vendor\Package\PackageServiceProvider".
  • If the addon requires manual registration, add it to config/statamic/addons.php; otherwise rely on Laravel/Statamic auto-discovery.
  • First use case: use the package’s primary entry point—typically an Antlers tag, fieldtype, modifier, or service—in a template, blueprint, or controller. Start with a single page or entry to validate the integration before rolling out.

Implementation Patterns

  • Pin to ^1.0 for Statamic 4 compatibility. If you maintain a Statamic 3 site, test v1.0.1 in a branch before upgrading production.
  • Inject the package’s services via the container in controllers, commands, or middleware. Avoid instantiating classes directly so you can swap implementations and test easily.
  • If the package exposes an Antlers tag, use it in templates with the documented syntax (e.g., {{ package:tag }}). If it provides a fieldtype, add it to the relevant blueprint and verify it renders correctly in the control panel.
  • Combine the package with Statamic’s caching layer. After changing package config or blueprints, clear the appropriate caches (see Gotchas).
  • In CI, run the package’s tests against both the minimum and maximum supported Statamic/Laravel versions declared in composer.json.
  • For custom behavior, prefer the package’s documented extension points (events, custom tags, or config overrides) over monkey-patching vendor code.

Gotchas and Tips

  • v1.0.1 is a compatibility release focused on Statamic 4 support. Confirm whether it remains backward compatible with Statamic 3 by reading the changelog and composer.json constraints.
  • Statamic 4 may require a newer Laravel version (e.g., Laravel 10+). Update your app’s PHP and Laravel dependencies if needed.
  • After upgrading, clear caches: php artisan config:clear, php artisan cache:clear, and Statamic’s Stache cache (php artisan statamic:stache:clear). Stale caches are a common source of “addon not working” issues.
  • If the addon does not appear in the control panel, check config/statamic/addons.php, Composer auto-discovery, and that the service provider is registered.
  • Use php artisan about and the Statamic control panel’s addon listing to verify the package is loaded and the correct version is active.
  • Debug template or fieldtype issues by checking the Statamic and Laravel logs (storage/logs/laravel.log) and temporarily disabling template caching.
  • Extension points vary by package; look for published config, events, or custom tags in the README. If none exist, open an issue rather than modifying vendor files.
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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core