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

Eloquent Tokens Laravel Package

bkremenovic/eloquent-tokens

Eloquent Tokens adds simple API token authentication to Laravel Eloquent models. Generate and hash tokens, assign abilities, set expirations, and verify incoming requests through a lightweight trait, with no extra guards or heavy configuration required.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Verify the framework constraint first. v2.0.1 is the release that adds Laravel 12 to the supported range (7.x through 12.x). On Laravel 12, require ^2.0.1; on older supported versions, any 2.x should still resolve.
  • Install or upgrade: bump the constraint in composer.json to ^2.0.1 and run composer update <vendor>/<package> -W, or composer require <vendor>/<package>:^2.0.1 for a fresh install.
  • Look first at the package's service provider and composer.json. The release notes only mention framework compatibility, so the integration surface—provider, facade, config, migrations, commands—is where your day-to-day usage actually lives.
  • First use case: take an existing Laravel 11 app that already uses the package, upgrade it to Laravel 12, run php artisan about, boot the app, and exercise the package's main entry point. That validates the compatibility claim before a wider rollout.

Implementation Patterns

  • Pin the floor, not just the ceiling. Use "<vendor>/<package>": "^2.0.1" so you get the Laravel 12 compatibility fix while still receiving 2.x patches. If your app or a shared library supports multiple Laravel versions, keep a CI matrix (7–12) and let Composer resolve per job.
  • Upgrade Laravel and the package together in one PR. Run composer update <vendor>/<package> laravel/framework -W, then php artisan config:clear && php artisan cache:clear before running tests.
  • Treat published config as application state. If the package publishes a config file, keep environment-specific values in .env and only re-publish when the stub changes. Diff before using vendor:publish --force—it will overwrite local customizations.
  • Exercise the provider boot path in tests. Use the package's facade or container binding in feature tests rather than pure unit tests, so service-provider registration and Laravel 12 boot behavior are covered.
  • Wrap package calls behind a small application service or interface. A thin adapter keeps a future major version—or a replacement package—from leaking into your domain layer.

Gotchas and Tips

  • PHP version floor moves with Laravel. Laravel 12 requires PHP 8.2+, so the package's effective floor is also PHP 8.2 on Laravel 12. If resolution fails, composer why-not php 8.2 will show the blocker.
  • Release notes are sparse. The 2.0.1 notes cover only the framework constraint. Read the full changelog and diff for the 2.0 line before upgrading in production; compatibility bumps can carry transitive dependency changes.
  • Stale config cache masks new keys. After upgrading, bootstrap/cache/config.php can hide additions. Always php artisan config:clear in deploy scripts.
  • Debugging dependency conflicts: composer show <vendor>/<package> and composer why-not laravel/framework 12 quickly reveal constraint clashes. php artisan about confirms framework and package versions at runtime.
  • Prefer extension points over forks. Publishable config, container bindings, and events are the usual seams. Extending via config or bindings keeps future Laravel compatibility releases drop-in.
  • Don't infer features from version support alone. v2.0.1 is a compatibility release, not a feature release. Treat it as a safe upgrade path to Laravel 12, not as new functionality to design around.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource