Urgent.News

What's breaking now, across thousands of outlets.

Tech

Credits, plans and quotas in Laravel with Larameter

If your app sells an allowance, a number of credits a month, or a number of documents, or a number of anything. Whatever it is, you end up writing a balance somewhere, a reset when the period rolls over, a check before the expensive call, and a usage screen that has to agree with all of it. None of that is hard on its own. What gets you is that the pieces drift. The plan says a thousand a month,…

Larameter is a Laravel package that helps manage credits, plans, and quotas in applications that sell allowances or document-related services. It simplifies the process of tracking credit usage, enforcing usage limits, and determining the appropriate plan for each account.

To get started with Larameter, install it via Composer and run the provided Artisan commands to publish the configuration and migration files. Next, add the `HasCredits` trait to the model representing your billed entity, such as an organization, user, or workspace. After that, define your allowance windows and plans in the configuration file. Windows can be set up for various time periods, such as sessions, weeks, or months, and can be configured with specific usage limits and constraints.

Plans determine the amount of credits allocated to each account, with options for free and paid tiers. The package calculates the appropriate plan based on the account's usage and automatically enforces the associated limits. Installation is straightforward, and Larameter provides a simple and intuitive way to manage credits and quotas in Laravel applications.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Generating 50+ SEO Landing Pages from a Static Site Build Script

I run TextTimeTools , a free site with speaking-time and reading-time calculators. It's a pure static site deployed to Cloudflare Pages — no backend, no database, no CMS.

  • Build script generates 50+ SEO-optimized landing pages automatically
  • gen-longtail.cjs creates individual pages for each keyword target
  • Four-step build pipeline maintains consistency without manual upkeep

More from Monday 24 August →