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

Laravel Model Expires Laravel Package

mvdnbrk/laravel-model-expires

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Enables time-bound model validity (e.g., subscriptions, trials, promotions) without manual expiration logic, reducing technical debt.
  • Roadmap Prioritization: Justifies investing in features requiring temporal constraints (e.g., "expire inactive users after 90 days") by simplifying implementation.
  • Build vs. Buy: Avoids reinventing expiration logic for Eloquent models, saving dev time and ensuring consistency across the codebase.
  • Use Cases:
    • Subscriptions/Payments: Automatically invalidate expired plans.
    • Temporary Access: Revoke API keys, trials, or demo accounts.
    • Compliance: Enforce data retention policies (e.g., GDPR "right to erasure").
    • A/B Testing: Sunset old test variants.
    • Inventory: Mark expired products/offers.

When to Consider This Package

Adopt if:

  • Your Laravel app uses Eloquent models with time-sensitive validity (e.g., subscriptions, trials, promotions).
  • You need consistent expiration logic across multiple models (avoids scattered if ($model->created_at > now()) checks).
  • Your team lacks time to build/maintain custom expiration logic.
  • You’re using Laravel 7+ (last release was 2020, but MIT license allows forks if needed).
  • You want database-level support (migrations for expires_at column).

Look elsewhere if:

  • You need real-time expiration checks (e.g., WebSockets) – this is database-triggered.
  • Your expiration logic requires complex business rules (e.g., "expire after 3 failed attempts + 24 hours").
  • You’re using non-Eloquent models or a non-Laravel framework.
  • You need soft deletes + expirations (consider SoftDeletes trait or laravel-model-soft-deletes).
  • The package’s 2020 release date is a concern (check for forks or maintenance status).

How to Pitch It (Stakeholders)

For Executives: "This package lets us automate expiration logic for time-sensitive features (like subscriptions or trials) with minimal dev effort. For example, we can enforce a 30-day trial period for new users without writing custom code. It’s like setting a ‘best before’ date for database records, reducing churn risk and compliance headaches. The MIT license means no vendor lock-in, and it integrates seamlessly with our existing Laravel stack."

For Engineers: *"This trait adds a single use Expirable; line to any Eloquent model to auto-manage expiration via an expires_at column. It handles:

  • Database migrations (via Schema::expires()).
  • Carbon casting for expires_at.
  • Soft expiration checks (e.g., if ($model->isExpired())). No more scattered now()->diff($model->created_at) logic. It’s lightweight (~166 stars, MIT license) and saves us from reinventing the wheel. The last release was 2020, but the code is simple enough to fork if needed."*
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.
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours