ARCHTECH (@archtechx) header
ARCHTECH (@archtechx) profile picture

Meticulously architected web applications. @TenancyLaravel v4 launching soon!

United States
Joined April 2021
The final step in generating each boilerplate setup is running tests (multiple variations, including regular tests, in-memory SQLite, and parallel tests) and if they all pass, create a zip file that users can download. If tests don't pass, the program reports which test run failed and how
1
2
140
Speaking of helpers, can't forget dd() 😁 If you're at least a bit familiar with Rust, you'll notice we use unwrap() a lot. This is intentional — there are basically no recoverable errors in our code, so they should all panic and report exactly where they happened
1
3
103
Most of the Rust code looks like this Functions that either modify files or copy stubs, and helpers that are called by those functions
1
2
128
This means the only things we need to maintain *separately* are views Separate views for Inertia and Blade/Livewire setups, also depending on the starter kit being used since they use different components and layouts
1
2
103
The methods shown above are used in controller *templates* like this one We keep route names consistent across setups, so the only things that need to change are usually view names (Blade vs Inertia) or parameters based on what the view might need
1
2
113
The first thing is having descriptive types for anything our code may want to know about the setup being generated Based on those types, functions adjust their behavior to the currently used frontend stack, database setup, identification method, or starter kit used
1
2
157
🦀 The neat thing is how we've implemented this. Maintaining 24 repos would be impossible, so instead we have a custom tool written in Rust for generating these setups Each generated setup has a clean git history and is automatically tested after being built Here's how we keep this maintainable 👇
🤯 Tenancy v4 will launch with 24 different SaaS boilerplate setups That is any combination of: - Jetstream with teams, Jetstream without teams, new Laravel 12 starter kits - Domain identification / Path identification - Livewire / Inertia + Vue - Multi-database / PostgreSQL RLS (new v4 feature!)
2
4
1
23
2,550
True! Over the years of working on Tenancy for Laravel, one of the biggest sources of pain was the queue logic. Difficult to test with just testbench, fixing bug A introduces bug B or some kind of regression, ... Spent a few days on writing a full *app-based* testing suite
There's nothing better than having a full testing workflow. There's nothing worse than setting up a full testing workflow.
1
1
14
2,711
Hence the `$_ =`. You only need to keep a reference to the PDO instance somewhere. The lifetime of the DB will match the lifetime of its longest reference. So you can do something like this to keep it alive until the end of the script Now, what's an actual use case for this?
1
315