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

Attributes Laravel Package

cartalyst/attributes

Cartalyst Attributes is a Laravel package for adding flexible custom attributes to Eloquent models. It provides an EAV-style attribute system with polymorphic storage, making it easy to extend models without schema changes.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Verify your runtime first: this release adds PHP 8 support, so confirm php -v reports 8.x and that your app’s composer.json allows it ("php": "^8.0" or similar).
  • Install/upgrade with an explicit constraint so you actually receive the PHP 8-compatible release:
composer require vendor/package:^5.1
  • Check composer.json requirements and the package’s service provider registration. If the package supports Laravel auto-discovery, no manual provider registration should be needed; otherwise add it to config/app.php.
  • Publish any package config before first use:
php artisan vendor:publish --provider="Vendor\\Package\\PackageServiceProvider"
  • First use case: configure the package’s credentials/options in .env and config/package.php, then run a minimal smoke test through php artisan tinker or a temporary route. This validates container binding, config loading, and PHP 8 compatibility before wiring it into real workflows.
  • Clear cached Laravel state after upgrading:
composer dump-autoload
php artisan optimize:clear

Implementation Patterns

  • Resolve the package from Laravel’s container rather than instantiating classes directly. Prefer constructor injection in controllers, jobs, commands, and services so tests can swap implementations.
  • Keep package calls behind a thin application service or action class. That isolates vendor APIs and makes future major-version upgrades less invasive.
  • Use the package’s facade only for terse, expressive call sites; use dependency injection where you need testability or multiple configurations.
  • Drive behavior through config and environment variables. Avoid hard-coding credentials, endpoints, or package-specific options in application code.
  • For slow or remote operations, wrap package calls in queued jobs. This is especially important on PHP 8 where stricter type handling can expose edge cases under long-running workers.
  • In tests, bind fakes or use Laravel’s HTTP fake facilities where applicable. Add at least one integration test that exercises the package through the container, not just isolated unit calls.
  • Update CI to include PHP 8 in the matrix, e.g. PHP 8.0/8.1/8.2 against your supported Laravel versions. Run the lowest supported dependency set as well as the latest.
  • If the package dispatches events or exposes extension points, hook into those rather than modifying vendor code.

Gotchas and Tips

  • “Adds PHP 8 support” is a compatibility release, not automatically a breaking-change-free release for your app. Review the package’s full changelog and test your actual usage paths on PHP 8.
  • PHP 8 is stricter about several things: required parameters after optional parameters, dynamic properties, undefined array keys, and type coercion. Run your test suite with deprecation notices enabled.
  • Watch Composer platform constraints. A root config.platform.php pinned to 7.4 can prevent installation or mask production behavior. Align local, CI, and production PHP versions.
  • After changing providers, config, or environment values, run php artisan config:clear and, if needed, php artisan package:discover. Config caching can make it look like new settings are ignored.
  • Restart queue workers and Octane/Swoole workers after deploying. Long-running PHP processes can retain old code or stale container bindings.
  • Use ^5.1 rather than a floating * constraint, and commit the lock file so deployments are reproducible.
  • For debugging, start with Laravel’s logs and the package’s own log channel/config. If the package offers debug mode, enable it only locally.
  • Common extension points to check first: publishable config, container bindings for contracts/interfaces, facade accessors, events/listeners, and custom drivers or adapters. Prefer these over subclassing vendor internals.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo