<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs" -->

---
title: New Package Laravel Rulebook: Well-Structured Business Rules
description: A walkthrough of the Laravel Rulebook package by Matias Onia, which lets developers codify time-based business rules (like grandfathered pricing plans) as...
canonical: https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: New Package Laravel Rulebook: Well-Structured Business Rules | daily.dev
og:description: A walkthrough of the Laravel Rulebook package by Matias Onia, which lets developers codify time-based business rules (like grandfathered pricing plans) as...
og:url: https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs
og:image: https://api.daily.dev/og/posts/FiXtbtggs.png
og:image:alt: New Package Laravel Rulebook: Well-Structured Business Rules
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New Package Laravel Rulebook: Well-Structured Business Rules

**[Laravel Daily](https://daily.dev/sources/laraveldaily)** · 10 min read · 3 upvotes · 0 comments

## Summary

A walkthrough of the Laravel Rulebook package by Matias Onia, which lets developers codify time-based business rules (like grandfathered pricing plans) as classes with priority and validity logic instead of scattered if-statements. The demo builds a realistic SaaS invoicing scenario where pricing changed across 2024, 2025, and 2026, showing how the package resolves which pricing rule 'wins' based on subscription date. The video also includes a sponsored segment for Letter, a transactional email platform for Laravel/SaaS apps.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=euEoyK87uj0>

## Questions this post answers

### How can I keep old pricing rules valid for grandfathered customers when my Laravel SaaS pricing changes every year?

Use a package like Laravel Rulebook to define each pricing period as its own rule class with priority and validity conditions instead of chaining if-statements. Each year's price (e.g. 2024, 2025, 2026) becomes a separate class extending an abstract rule, and the rule book resolves which rule 'wins' based on when the customer subscribed, keeping old invoices stable even after prices change.

_Developers designing versioned pricing logic can track Laravel package updates like this on daily.dev._

### What is the Laravel Rulebook package used for?

Laravel Rulebook is a package by Matias Onia for codifying business rules that change over time, such as pricing tiers that differ by subscription year. Instead of writing scattered if-statements, developers define rule classes with priority and evaluate methods extending a base Rule and RuleBook class, and the package resolves which rule applies for a given date or context.

_Laravel developers weighing new packages for structured business logic can follow coverage like this on daily.dev._

## Similar posts on daily.dev

- [Laravel Rulebook: Business Rules That Change by Date](https://daily.dev/posts/laravel-rulebook-business-rules-that-change-by-date-2z40ztunf) · Laravel News · 26 upvotes · 2 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#php](https://daily.dev/tags/php), [#laravel](https://daily.dev/tags/laravel), [#design-patterns](https://daily.dev/tags/design-patterns)

[View this post on daily.dev](https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"New Package Laravel Rulebook: Well-Structured Business Rules","url":"https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs"},"datePublished":"2026-09-03T07:37:30.629Z","dateModified":"2026-09-03T07:37:51.173Z","description":"A walkthrough of the Laravel Rulebook package by Matias Onia, which lets developers codify time-based business rules (like grandfathered pricing plans) as...","image":"https://i.ytimg.com/vi/euEoyK87uj0/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/euEoyK87uj0/sddefault.jpg","isAccessibleForFree":true,"articleSection":"Laravel Daily","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Laravel Daily","logo":"https://media.daily.dev/image/upload/s--vzdgNGfl--/f_auto/v1725044498/logos/laraveldaily","url":"https://daily.dev/sources/laraveldaily"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,php,laravel,design-patterns","timeRequired":"PT10M","video":{"@type":"VideoObject","name":"New Package Laravel Rulebook: Well-Structured Business Rules","description":"A walkthrough of the Laravel Rulebook package by Matias Onia, which lets developers codify time-based business rules (like grandfathered pricing plans) as...","thumbnailUrl":"https://i.ytimg.com/vi/euEoyK87uj0/sddefault.jpg","uploadDate":"2026-09-03T07:37:30.629Z","duration":"PT10M","url":"https://api.daily.dev/r/FiXtbtggs","embedUrl":"https://www.youtube.com/embed/euEoyK87uj0"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Laravel Daily","item":"https://daily.dev/sources/laraveldaily"},{"@type":"ListItem","position":3,"name":"New Package Laravel Rulebook: Well-Structured Business Rules"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/new-package-laravel-rulebook-well-structured-business-rules-fixtbtggs#faq","mainEntity":[{"@type":"Question","name":"How can I keep old pricing rules valid for grandfathered customers when my Laravel SaaS pricing changes every year?","acceptedAnswer":{"@type":"Answer","text":"Use a package like Laravel Rulebook to define each pricing period as its own rule class with priority and validity conditions instead of chaining if-statements. Each year's price (e.g. 2024, 2025, 2026) becomes a separate class extending an abstract rule, and the rule book resolves which rule 'wins' based on when the customer subscribed, keeping old invoices stable even after prices change. Developers designing versioned pricing logic can track Laravel package updates like this on daily.dev."}},{"@type":"Question","name":"What is the Laravel Rulebook package used for?","acceptedAnswer":{"@type":"Answer","text":"Laravel Rulebook is a package by Matias Onia for codifying business rules that change over time, such as pricing tiers that differ by subscription year. Instead of writing scattered if-statements, developers define rule classes with priority and evaluate methods extending a base Rule and RuleBook class, and the package resolves which rule applies for a given date or context. Laravel developers weighing new packages for structured business logic can follow coverage like this on daily.dev."}}]}
```

