Domain Testing

New software is often tested through a variety of methods such as unit testing, feature testing and integration testing. Recently we’ve been making some major upgrades to the Icehouse Ventures investor portal and we’ve wanted to be sure that the changes to the software don’t change the business logic. I think the style of testing we’re doing might be useful for other teams to explore. We’re calling this new style of testing “Domain Testing”.

Domain testing focuses on validating the correctness of our application’s business rules and domain-specific logic. Rather than testing technical implementation details, “domain tests” verify that the system produces the correct outcomes in realistic business scenarios.

In our venture capital context, this means ensuring that complex financial workflows such as fund management rules or carry waterfall calculations behave as intended. For example, one of our domain tests verifies that when a startup company generates a return, the correct amounts are shared across investors.

All software teams have been doing some kind of “scenario testing” forever in various forms, but we haven’t always had a consistent name for it. Domain testing focuses in on testing a specific business function. The goal is to prove that real-world business rules hold true, using concrete examples that reflect how the software is actually used.

Domain Testing vs Existing Types of Tests

  • Unit Tests validate individual methods or classes in isolation. Checking that a specific function returns the expected number given certain inputs.
  • Feature Tests cover entire user-stories, or features potentially including the user interface, controllers and the database, often crossing multiple domains or services.
  • Integration Tests verify that different parts of the system interact correctly. In Laravel, this might mean simulating an HTTP request and asserting that the controller, ORM, and database all work together.
  • Domain Tests validate specific business scenarios. They don’t necessarily go through the UI or HTTP layer. Instead, they check domain logic directly in the code. The key difference is that domain tests explicitly encode business intent.

For example, consider this finance module scenario:

Given a fund of $10 million with an 8% preferred return hurdle,
When the fund earns $2 million of returns in its first year,
Then the investors (LPs) should receive their preferred return before any carry is distributed to the fund manager.

This reads like a real scenario. It verifies that the carry distribution follows the defined waterfall (a critical business rule) without getting off track into implementation details.

Test Driven Development for AI

The long established practice of “Test Driven Development” could take on new importance in the era of AI-assisted development. Modern LLMs like Claude and ChatGPT are quickly evolving from simple code auto-completion tools into reasoning agents that can create or update whole new features. But as the scope of AI development widens, the consequences of errors is becoming more serious.

A solid test suite serves as both a safety net and interestingly as a guide when an AI helps generate code. LLMs are powerful but prone to hallucinations or subtle logic errors.

By writing tests upfront (especially Domain Tests that define expected outcomes) we create guardrails that keep the AI on track. The developer specifies the correct business behaviour in the tests, and the AI must work within those constraints. This turns TDD into a way of “teaching” the AI what we actually want.

Domain Tests as Executable Documentation

Domain tests create a shared language of expectations that both humans and machines can understand. Written in terms of business scenarios using clear language and examples, they serve as executable documentation of what the software should do.

Developers, product managers, and even non-technical stakeholders can read these scenario-based tests and understand the system’s intended behaviour. The test suite becomes a living specification of the domain.

This clarity extends to AI systems too. An LLM assisting you can read your domain tests and see the business rules and constraints of your application. If it proposes a refactor or new feature, you can re-run the domain tests to verify the AI didn’t break any fundamental business rules. Our domain tests encode the business rules in a form that a machine can work with.

Domain-Driven Design

DDD teaches us to model software around the core business domain. In domain testing, we leverage these same concepts. One of the concepts we borrowed from DDD for our domain tests was “inspectability”. Meaning that you should be able to put the system in the ‘test’ state and let a human look at it.

Normal software tests are usually randomised and empheral, not designed for human inspection. Using a specific, repeatable scenarios is like the Kobayashi Maru simulator test in Star Trek, the setup is consistent so you can explore different solutions that achieve the end goal.

Practical tip: We use Laravel’s “factories” and “seeders” to set up our domain scenarios. This way we can quickly spin up a fake Fund with ten fake investors, each with certain ownership percentage, then create transactions to simulate cash flows. When your test reads like a story, you know you’re staying true to the domain-driven spirit.

Behaviour-Driven Development

BDD’s Given/When/Then syntax models test scenarios in a way both developers and business stakeholders understand:

Given: a scenario setup
When: something happens in our system
Then: the result is a predictable output.

This structured narrative helps communicate intent. A finance expert could glance at this test and confirm, “Yes, that’s exactly how the waterfall works.”

You can implement this style in Laravel with PHPUnit or Pest. The key is writing tests that tell a story: set up context (Given), perform an action (When), and describe the expected outcome (Then). For normal tests we use Arrange, Act, Assert which is also fine but slightly less suited to domain tests.

A Practical Way to Calibrate AI and Humans

Looking forward, I think domain tests may become a crucial calibration tool between business intent and AI execution. Think of them as the training examples you provide to a junior developer, except the dev will be an AI.

If an AI proposes a database schema change or generates a new Laravel controller, how do we ensure it didn’t break fundamental business assumptions? Run the domain tests. A comprehensive suite will immediately flag any business rule violations, giving both human and AI rapid feedback.

Domain tests also become a sandbox for business validation. Write a test that sets up a complex fund with edge cases (different fee structures, multiple closing dates), run the domain logic, and use Laravel’s debugging tools to inspect the output. It’s like a flight simulator for our business logic, we can try scenarios out in a safe environment.

Implementation in Laravel

Laravel makes it easy to implement domain testing:

  • Use model factories to create realistic test data that feels real.
  • Create dedicated test seeders that load the complete scenario in a repeatable way.
  • Leverage database transactions or RefreshDatabase traits for test isolation.
  • Structure tests around your domain services, actions and jobs, not just http endpoints.

Your tests become a place where everyone can see the essence of the application laid out in scenarios, where changes can be vetted with confidence, and where future tools can learn what “correct” means in your context.

Conclusion

Domain testing is a practical way to:

  • Validate business-critical behaviour with high confidence, if a change breaks fund carry distribution maths, a domain test will catch it.
  • Communicate intent across disciplines through tests written in business language, serving as living documentation.
  • Build on the best of TDD, BDD, and DDD without reinventing the wheel.
  • Prepare for AI-assisted development by creating tests that define boundaries of correct behaviour and logic.

As we rediscover testing principles in the age of AI, domain testing could be a language of shared understanding between humans, software, and intelligent agents. It ensures that no matter how our code is written (by us or by AI) the true intent and logic of our business domain remains solid.

Icehouse Ventures Mobile App Launch

Script from the launch of the Icehouse Ventures mobile application at the Annual New Zealand Startup Showcase at Spark Arena on 21 August 2025. We had some tech issues on the night, but it was great to share what we’ve been working on with so many people, and so far the reaction from users has been great.

Good evening everyone. My name is Peter Thomson, and I’m the CTO at Icehouse Ventures. I have what I think might be one of the best jobs the country because I get to spend my time with all of these great startups we’ve heard from tonight and all of you as investors. It’s like Showcase all year round.

I’m particularly grateful to our early adopters many of whom are here tonight like Maurice Maclaren, Richard Reynolds and Ian Holland. Who’ve given us such great feedback over the years.

At Icehouse Ventures, our greatest strength has always been our community of investors, founders and operators. The great startups coming out of New Zealand can become even more unstoppable with a large & engaged network backing them.

But to be engaged, you first need to be informed. And that’s what we’ve been working on for the last five years with our custom-built Investor Portal. When we started on this journey, there wasn’t any software available that could connect a large network of investors with a diversified portfolio of startups, to deliver an immersive experience, while maintaining institutional-grade reporting and security. It didn’t exist, so we had to build it.

But now it’s time to take things up a notch. We want to supercharge your ability to support these great companies. And to do that, we’re going mobile.

Tonight, we’re proud to introduce the Icehouse Ventures Mobile App (available now on iOS and Android). This new app is your window into the people, ideas, and companies building the future of New Zealand. We’re putting the brightest New Zealand companies in your pocket. With a host of new features, you can be engaged with these great companies, not just at Showcase, but all year round. Let me walk through just a couple of the features before I hand back to Robbie.

First, Discussions and Co-Investment. Imagine getting to tap into the experiences & connections of 3,000 fellow investors. With this app, you can now read Investment Memos on the go, ask questions of the founders and participate in due-diligence discussions. It’s the professional investing experience that we’ve always delivered, made portable.

Second, Notifications. These days, startup investing can move fast. Whether it’s a new round opening up, or a capital call. You don’t want to miss out. And recently, Halter’s follow-on round was over-subscribed within a matter of days. The app will help keep you in the loop.

And third, Show & Tell. If you’re in this room, you already know that there are great companies, doing great things here in New Zealand. But not everyone sees what you see. We want to give you a window into their world, one that you can share with your family, your friends, and your colleagues. We want to bring you short, sharp videos direct from the startups so you can stay up-to-date and share their stories.

What I love most about this asset class is how it can inspire the next generation, Our seven year old, Isabelle has recently started getting interested in tech companies and it’s not because of the TVPI or the IRR, it’s because she and I started watching videos together about what the companies are up to. She saw when OpenStar first sparked plasma in Wellington. And she came along for the ride along as Dawn Aerospace took off for space. This isn’t doom scrolling, it’s a front-row seat to history.

Our growing tech platform is built to give New Zealand an unfair advantage. And pursue our mission of making investing in Kiwi startups: transparent, engaging and rewarding. The mobile app was built in-house by our Principal Engineer, Ian Patel and it runs on same core system that powers our main Investor Portal. So we all benefit from the years of hard work by Harry Fakir, Logan Gubb, Nikita Deva, and the rest of the Icehouse Ventures team.

So tonight, we invite you to download what we believe could be a world-first: The chance to have an entire VC firm in your pocket. Please, use the app to amplify the stories of these great companies within your own networks, because the startups are already doing great things, and with your backing, they can be truly unstoppable.

You can watch a clip from the live stream of the presentation on stage here (5 mins):

Laravel for Business Professionals

As technology becomes central to modern business functions, professionals in marketing, finance, and operations increasingly want to tackle projects traditionally reserved for software developers. Having transitioned from corporate law to marketing and then to software development, I’ve gathered tips to make the journey into vibe coding easier and more enjoyable.

Modern AI tools significantly lower the barrier to entry for coding, but there is still a learning curve to being productive in a business setting. My goal here isn’t to turn you into a full-time software engineer, instead the goal is for you to use AI to better understand and work with complex business systems. You can use modern AI coding tools to explore, tweak and build business workflows in hours that would have traditionally taken weeks to implement.

Why Laravel?

Beginners and non developers are often steered by AI toward JavaScript frameworks like Next and React, or Python for data science. I think this is a mistake because:

  1. PHP has 20 years of open-source history, giving LLM models rich context for solving any business problem you encounter. The training examples and content for Laravel apps are often practical B2B SaaS in complex industries like finance, healthcare and manufacturing. Laravel is used by Apple, NASA, Ferrari, DHL, Square Payments, The New York Times, Marvel and OpenAI along with thousands of SaaS startups and in-house custom business applications.
  2. Laravel is a powerful framework that includes robust authentication and database setup out of the box—features that beginners often struggle to implement securely.
  3. PHP excels at rapid prototyping. Plus, if your business has an in-house SaaS platform, there’s a good chance it’s built in Laravel. It makes more sense to learn Laravel from the start rather than coding everything in React only to switch languages later.
  4. The fundamental model of Laravel with MVC, database and logic layer makes it the preferred choice for a lot of SaaS startups, in-house tech teams and digital agencies building rapid prototype software for clients. 

Personally, I’ve fallen in love with Laravel because of the helpful community and the focus on clean, minimalist code. The framework is magical for taking complex business domains like investment, finance, education, health or other industries and building software that solves real business problems fast. With AI tools improving rapidly, real code is rapidly replacing low-code tools as the best way to spin up software to streamline business processes.

Every day I’m thankful that we made the call to build the Icehouse Ventures in-house investor portal in Laravel because we have complete flexibility to add features and customisations that suit our exact business model (a large and diverse network of investors making long-term investments into a widely diversified portfolio of tech startups). Using Laravel for the last five years has helped us scale to become the largest and most active Venture Capital firm in New Zealand. Having custom software has allowed us to build investor and founder support functionality, data analysis, and advanced automations that no other VC firm has access to.

Laravel has robust tooling for solving business problems such as custom CRM systems, automating workflows, modelling complex business processes, and integrating with third party APIs data sources. Imagine Excel, HubSpot, Salesforce, Zapier and Notion all in one place and with complete freedom to wire things together in ways that suit your exact business.

Setting up your machine

To start using Laravel you’ll need to set up your machine. Hardcore engineers spend most of their time on the command line for tooling and setup. One of the things that helped me transition into development and suits my big-picture desire for an overview of what’s going on in a system is to use a lot of GUI or visual tools. I find that visual tools make it much easier to understand how a Laravel application works and how to make changes. There are a few key tools that will help you get started:

Version Control: SourceTree

Version control is like a giant upgraded version of a word processor’s ‘track changes’ feature. Full time software developers use version control systems to make sure that they can’t lose their work and that multiple people can work on a project at the same time. It’s useful to have a version control tool on your machine so that you can see the other branches of code and it provides a simple place to make forks of code and to review your changes.

Github is where your company’s code base is most likely contained. SourceTree is a great git client that provides a visual interface for managing your codebase. It makes it easy to commit, push, and pull changes, as well as resolve merge conflicts. Version control is essential when working with AI code tools because it lets you experiment without breaking the main codebase.

Database: TablePlus

A relational database is like a giant spreadsheet with lots of tabs and links between the rows. The database is a key part of a modern web application so you’ll need a way to access your local copy of the database and to see what’s going on. Sequel Pro and TablePlus are both excellent visual tools for accessing a local database so you can see the changes that your application is making. You’ll set up your application’s database later in the process, but having a database viewer set up early will help you debug things and access the database manually as soon as it’s loaded.

Text Editor: Cursor

An integrated development environment is like a word processor specially designed for software development. I personally use Sublime as my text editor for its speed, calm interface, and minimalist design. However, for business professionals accessing their company’s codebase, I recommend Cursor. It combines VSCode’s benefits (plugins and customizability) with powerful integrated AI support.

Cursor’s AI support has several evolving layers, and it’s worth understanding how each can help you engage with a codebase:

  1. Tab / Autocomplete Mode – Works well with existing Laravel code to add small features and tweak the wording on web pages.
  2. Chat / Ask Mode – Great for exploring the code without making unnecessary changes.
  3. Agent / Edit Mode – Modern LLMs can make significant progress on building new functionality in a Laravel app. But they need careful guidance and clear instructions.
  4. Bug Fix / Pull Request Mode – This allows you to review changes and do quality control.

Cursor Plugins

There are a few things you can do to set up Cursor to work really well for Laravel development:

  1. Laravel – The official VS Code plugin helps Cursor to understand Laravel code. 
  2. PHP Intellephense – This is what allows you to click through different functions and see the context for the code.
  3. Back & Forth – This adds a ‘back button’ to the top of the editor window which is awesome for navigating around the code base. 
  4. Duplicate File – A better copy/paste that makes the sidebar faster for duplicating files (which you’ll be doing a lot of if you’re starting out). 

Cursor AI Setup 

There are several things you can do to get the most out of modern AI support:

  1. Add a Cursor rules file to your project if there isn’t already one. This should contain some context on the application and a style guide. 
  2. Add links to the Laravel documentation to your Cursor “docs” setup. I use the secret Laravel Illuminate API docs which are a machine readable version of the human Laravel documentation. 
  3. Like with other advanced business projects it’s worth chatting with an LLM before starting work to make a plan and an outline. You can add these to Cursor by adding a file such as “project_plan.mdc” (markdown format) to the home folder of your project. Then add that to the context when asking the AI for help with specific tasks.

Virtual Machine: Herd

Laravel has several methods for getting a local copy of a code base running on your machine. Docker and Valet are both excellent options but there days Laravel Herd is the fastest way to get up and running. The virtual machine is what allows the application code that usually powers a website to run locally on your own machine without the internet. You can access the website using a normal web browser but instead of calling the internet, it just calls your local machine.

Scratchpad: Tinkerwell

One of the tools I wish I’d had earlier in my journey was a way to run tiny blocks of code without having to change the whole application. Tinkerwell is a tool that lets you write standalone php code and run it with the context of your Laravel application. It’s rocket-fuel for experimenting with random ideas. For example, I recently used Tinkerwell to loop through our portfolio and analyse the gender balance of founders without needing to write permanent code or do a pivot table in excel.

Getting Started: Laravel Starter Kits

The Laravel Documentation has good examples of how to create your first Laravel application. Personally I’d suggest choosing a simple first-party Laravel Livewire starter kit with Tailwind. There are lots of third party starter kits with React, Vue and other front-ends but Livewire keeps things simple. The official Laravel documentation has a great step-by-step guide to seeing up your first Laravel application.

Laravel Cloud provides a fast and easy place to deploy your first application if you need to share it with other people for testing. There are also lots of great resources on how to deploy a Laravel application to AWS and other web hosting platforms. 

Key Concepts

There are a few key concepts that really help when experimenting with a code base and when discussing project with your development team. 

Model View Controller

The Model-View-Controller (MVC) architectural pattern is a fundamental concept in Laravel. It separates the application logic into three interconnected components: the Model handles data management, the View manages the user interface, and the Controller acts as the intermediary, processing user input and coordinating the flow of data between the Model and View. Think of MVC like a restaurant: the kitchen (Model) prepares the food (from ingredients like the database and any APIs), the waiter (Controller) takes orders and delivers food, and the front of house dining area (View) presents the meal.

Relational Databases

Relational databases are the backbone of most Laravel applications, providing a structured way to store and retrieve data. Familiarizing yourself with concepts like tables, columns, rows, and relationships will help you understand how to model your application’s data and leverage Laravel’s powerful Eloquent ORM (Object-Relational Mapping) to interact with the database. This knowledge will empower you to create robust data-driven applications that can scale and adapt to your business needs.

Database Seeding

If you are starting out with a new application to experiment or your business is in an industry where sharing production data is prevented for privacy reasons then it may be better for you to use synthetic data. Most teams will have a masked-data dump or a test database available but it’s worth understanding the concept of Seeders in Laravel as they allow you to create your own test data. Seeders are a command that creates multiple fake but realistic rows in the database and links them together. Using fake data makes it much safer to test new ideas.

Test Driven Development

Laravel has automated testing out of the box. If you are building a new feature or a proof of concept then adding automated tests is a great way to guide the AI and to prove to the rest of your team that you’ve thought through what you’re trying to achieve. I use a lot of “smoke tests” which means if you try the thing using the happy path (all data in place and doing the main thing the page does), does it work or does it smoke / catch fire when you turn it on. LLMs are great at generating tests and knowing that the tests pass is a good way to check the AI’s work.

Proof of Concept

The concept of minimum viable product comes from venture capital and is a great thing to work towards. But if you’re vibe coding it’s more sensible to aim for a simple “proof of concept” which is code that isn’t intended to be ‘viable’ as in secure, performance optimised and robust enough for production. Instead, a proof of concept is intended to demonstrate the functionality you want in a proposed feature and to help visually communicate across teams. Traditionally this would have been done with paper sketches, prototype or design tools. But with rapid AI advances it’s often useful for business users to have a go at exploring the proof of concept themselves. 

Being a team player 

If you are working in an existing code base there are some unspoken rules that can help you be a good citizen. AI can allow you to understand, modify and add to a Laravel application very quickly. But it’s worth playing nicely with your existing development team (if you have one, or might hire one in the future).

  1. Make the smallest changes possible (don’t let the AI run wild and re-write the entire code base as it makes things hard to review). Stay focused on one proposed feature or idea. (Doing too many things in one branch can confuse the AI and the humans you have to collaborate with). 
  2. Ultimately, product teams do much better with “user needs” as a brief than a proposed solution because often the best solution is deeper in the architecture of a problem or root cause. So don’t just make a proof of concept and say “here just implement this”, instead use the POC as a starting point for a conversation about what you are trying to achieve and why it’s important to the business. 

Problem Solving

For a non technical professional exploring code one of the key things I learned was to slow down and read the documentation and any error messages. They may look confusing, but Laravel’s error messages are carefully crafted to guide you but it takes real effort to slow down, read them methodically. The error messages are also gold for pasting back into the AI to help debug. 

The journey

I got started on the journey from lawyer, to marketer, to software developer (and now Chief Technology Officer of the product team at a Venture Capital firm) by simply making small changes to an existing code base. There is certainly a scenario where AI replaces the need for software developers entirely, so learning to code is a waste of time. But I think it’s more likely that AI allows non-technical subject-matter-experts (that’s you) to meaningfully engage with code in new and exciting ways that opens up the profession to thousands of people from diverse backgrounds and mindsets who can bring new best practises and new solutions. There’s never been a better time to start coding. 

Top Laracon Conference Presentations

Laracon is an ongoing series of conferences and events about the Laravel software development framework. We use Laravel pretty heavily at Icehouse Ventures because it powers our Investor Portal. I’ve learned a lot over the years from the various Laracon conference recordings. The topics range from basic coding best-practises to advanced systems architecture, database design, all the way through to user interface design. The talks I get the most out of switch between broad theoretical best practises but then back it up with practical live coding examples. I’ve made a list with a few of my favs and some notes on how they influenced view of what’s possible with Laravel…

SOLID Design Principles

This talk with Katerina Trajcevska covers the basics of the SOLID coding principles. SOLID is short for:

  1. Single responsibility principle,
  2. Open-closed principle,
  3. Liskov substitution principle,
  4. Interface segregation principle, and
  5. Dependency inversion principle.

The SOLID jargon can seem heavy at first, but it actually fits nicely into good Laravel coding practises and Katerina lays things out simply and clearly.

Curing the Common Loop

This talk probably changed my approach to coding more than any other talk. The idea of using chained functions, scopes and collections aren’t that revolutionary by themselves, but seeing Adam collapse whole pages of complex nested code into a single line is just magical. The elegance, power and simplicity of Laravel collections when they’re used properly blew my mind.

CRUDDY by design

Another mind-bending talk from Adam Wathan. CRUD is short for:

  1. Create
  2. Read
  3. Update
  4. Delete

I do not necessarily agree with everything this talk, but the mental exercise of trying to see everything in a modern web application as a CRUD operation is a matrix shifting moment of clarity. We now heavily use Laravel’s built in “Resource Pattern” to link models, views and controllers into common CRUD functions.

Eloquent Performance Patterns

Eloquent is the data modelling ORM (Object Relational Mapping) tool built into Laravel. It’s an amazing tool, but Jonathan comes from a ‘bare metal’ background and like me, learned MySQL years before he learned to code in a modern framework. As such, he thinks in raw database queries. Laravel’s ‘Query Builder’ is the database layer that gets things from the database before passing them to Eloquent (to wrap the richness around). This talk is all about speeding up Eloquent by doing more in the database.

Laravel Performance Optimisation

Kasia Zien takes a pretty detailed and hard-core approach to performance optimisation, but it’s eye opening to see her logic for how to squeeze the best performance out of Laravel.

Software Design Patterns in Laravel

“Design Patterns” are best-practises or standard approaches to common problems in programming. Not every design pattern is a good habit (the repository pattern can over-complicate a project fast). But when used carefully, the various software design patterns make for better and more consistent code. We use the Presenter Pattern at Icehouse Ventures to tidy up data before sending it to our Vue JS front-end.

The Laravel Way

Jeffrey Way is one of the original gangsters in the Laravel community. As an OG, he’s been working with Laravel so long that he’s drawn out the broader mindset of what I think of as the “Laravel Way”.

Chasing Perfect Code

Yet another Adam Wathan talk, but honestly every one is a level-up in terms of how I write code. Adam goes through ‘code smells’ and things to tidy up. Things like nested-conditionals may technically work in a solo project or a university code exam, but in the real world our code needs to be read by other developers or by your future self. This presentation taught me to make my future self’s life easier with code that is simple, readable and clear.

Diving Deeper

One of the things I love most about Laracon is being exposed to more advanced topics in software engineering that I might not have otherwise discovered. For example:

  1. Database Indexing – The art of indexing a database is kind of obscure, but the pursuit of fast queries and ‘groking’ database indexing stretched my mind and reminded me how much I love MySQL.
  2. Denormalisation with Eloquent – The Icehouse Ventures investor portal calculates pretty advanced ‘professional investor grade’ maths and charts like IRR, TV/PI and other venture capital finance metrics. Many of those are too complex to run on the fly so we tried caching them. But with thousands of investors and hundreds of metrics our cache became a mess. Database normalisation saved us but also forced me to learn about cache warming and cache invalidation. This is the Laracon talk I wish I has watched before we built our Entity Stats table by hand.
  3. Resisting Complexity – When I dive into the Laravel core code (the stuff we’re not really supposed to see and can’t edit) I’m always surprised by how small each function is. Each function does one thing, then passes it onto the next atomic unit. At first it seems wasteful, but Adam walks us through how breaking big functions into small ones makes them cleaner, clearer, more re-usable and more testable.
  4. Clean Code – Uncle Bob invented the SOLID principals and is a legend in software development. Not Laravel specific, but a great reminder of the wider context of why clean code matters.
  5. Design Patterns that pay off – Matt Stauffer lays out some advanced design patterns and boils them down into simple good habits for good code.

I’ve saved all these Laracon presentations as a YouTube playlist so it’s easy to find them, play them and refer back to them in the future: Laracon YouTube Playlist

Using JavaScript with Laravel through Inertia and Livewire

For the upcoming Icehouse Ventures investor portal we chose to build the application using Laravel, which is a php framework. Frameworks like Laravel speed up the development process by providing a lot of the scaffolding that you need for a modern web app.

Mockup of the upcoming Icehouse Ventures Investor Portal.

We started off looking at using off-the-shelf tools such as venture capital fund management software and various online angel network platforms. But we couldn’t find any tools that would allow us to provide combined reports that showed a consolidated view of both direct angel investments into a company and indirect fund investments into the same company through a fund the investor was a part of. Investors told us that this was a mission-critical feature so they could evaluate their effective exposure to particular startup companies in their portfolio.

We also evaluated a range of other low-code and no-code solutions such as Salesforce and various template-based databases and website builders. These were ok, but couldn’t handle the depth of complexity investors wanted such as calculating IRR over long time periods, exporting PDF statements and ranking portfolio performance against other investors.

Laravel uses the classic Model-View-Controller architecture.

In the end, we chose php and in particular Laravel because of the robust stability of a MySQL database and the power of the Model-View-Controller approach to the code structure. MVC is a common pattern used in enterprise architecture to build scalable and stable software systems, the key elements are:

  • Model – A data model that manages your database and represents data as objects that can have relationships with other objects. For example, we have a model for Users and a model for Companies in the investor portal.
  • Controller – Traffic controllers that manage how data moves around your application. Controllers fetch data from the Models and send it to the Views. In Laravel, the controllers do a lot of heavy lifting in the background such as security, permissions, sorting and filtering.
  • View – Templates that render html and CSS for the end-user to see what you want to show them. Laravel uses a php and html template format with no JavaScript interactivity by default.

Adding JavaScript to Laravel

As much as I love php, we wanted to provide investors with a modern app-like experience. To do this we needed a modern JavaScript framework such as React (from Facebook), Angular (from Google) or Vue (an open-source JS framework). I chose Vue because it’s popular in the Laravel community, not owned by a giant tech company and is the fastest to learn for a non JS developer like me.

There are several approaches to getting front-end JavaScript frameworks to work with back-end applications like Laravel:

ApproachAdvantagesDisadvantages
Single Page Application with API – The traditional approach has been to build the JS front-end as a single page application and feed the data through to the app using a private API.By keeping things separate, it’s easy to focus on one thing at a time. Back-end developers can work on the back-end code and front-end developers can focus on the front-end code.My experience with SPAs was that I wasted a lot of time keeping the API and the front-end talking to each other. Frustrating points included login tokens and data-table filtering. In a small in-house tech team there’s no such thing as separate back-end and front-end teams, we’re all full-stack by necessity.
Livewire – This approach allows you to use little bits of JavaScript inside your normal php templates.It’s cool to have php everywhere and JavaScript only where you most need it. Like a modern framework approach to JQuery.The disadvantage of Livewire is that it’s still mainly using php not JavaScript, so it doesn’t have the app-like feel of an SPA. It’s also not full-on best-practice JavaScript using Vue or React so you miss out on the Vue and React templates and resources.
Inertia – This is a new way to use JavaScript inside the MVC framework of a php app. The Model and Controller are in php and the View is in JavaScript.Best of both worlds. Inertia lets php do what it does best (databases, models, relationships, security, etc) and JavaScript can do what it does best (render the front-end interface and provide interactivity).Not technically an SPA. Requires some finesse to make it feel fully app-like and the progress loader is a bit clunky. Inertia puts JS right inside your php monolith so you now have a multi-language code base that might feel weird to some developers.
Livewire is a new method for using JavaScript inside a php template.

Laravel 8 was released recently and now includes both Livewire and Inertia as options for the default Laravel user interface templates (called Jetstream). This is exciting because it will expose these two new approaches to more developers. But it’s been confusing for a few developers who are used to thinking of JavaScript as a different world from php.

Inertia allowed us to use Vue JS in our Laravel app.

On balance, we opted to use Inertia for the Investor Portal because it kept our code base all in one place and allowed us to move fast and change things quickly based on user feedback. I’ve already had dozens of moments where we wanted to make a change to the way that something is displayed in the portal. It’s a true joy to be able to make a quick change to the Company model, flow it through the Direct Investments controller and have it pop up in the investor portal Vue file all in the same code-base, with easy Laravel debugging and easy feature-testing and front-end testing. By having Vue running inside Laravel I’ve upskilled quickly on JavaScript without having to go all-in on complex JS routing and data manipulation.

Notice the simple call to Inertia from the Controller. Just like a Blade template.

We also went for Tailwind CSS instead of the more established Bootstrap CSS framework. Tailwind is a utility framework approach which means that instead of single giant templates in CSS with little HTML tags you just layer lots of little HTML tags onto an element to make it look the way that you want. It seems messy at first but once you get used to it, it’s life changingly fast. Using Tailwind, Alipne JS, Livewire and Laravel is called the TALL stack and I’m calling Vue, Inertia, Tailwind and Laravel the VITL stack. (Some people prefer the name LIT for this stack but I think Vue is a vital part of what makes this approach so awesome).

Building software in-house is an unusual move for a Venture Capital fund but Icehouse Ventures has a unique approach that combines the scale of the Ice Angels network and the depth of major funds like IVX and Tuhua. Globally, the venture capital industry is being quickly re-shaped by increased investor demands for transparency & reporting and by startup founder demands for faster decision making & streamlined capital raising processes. Technology can be a force multiplier for us and having both php and a modern JavaScript framework like Vue in our toolkit means that we can move faster while still keeping things safe, stable and secure.