• Makers Make by SaaSykit
  • Posts
  • Laravel 11.34 released, defer() practical use-cases, record-breaking Black Friday and more!

Laravel 11.34 released, defer() practical use-cases, record-breaking Black Friday and more!

What an incredible Black Friday for SaaSykit! I’m happy to welcome dozens of new members to our growing community. Thank you for choosing SaaSykit to power your SaaS journey! 🎉😍

Meanwhile, Laravel keeps pushing the boundaries with the release of version 11.34, packed with exciting new features. Let’s dive in! 🚀

Laravel 11.34 is released 🚀

Here’s a concise summary of the Laravel 11.34 updates

  • Spell ordinals as words
    The new spellOrdinal() helper in the Number class allows spelling ordinals as words:

echo 'The ' . Number::spellOrdinal(15) . ' item on the list.';
// Output: The fifteenth item on the list.
  • Conditional logic for route definitions
    The Conditional trait enables adding conditional logic when defining routes:

Route::middleware('region')
    ->domain('{region}.example.com')
    ->when(App::isProduction(), function ($route) {
        $route->whereIn('region', app(RegionService::class)->getRegionSlugs());
    });

  • Shorthand fakes for HTTP responses
    You can now use shorthand notations for faking HTTP responses:

// Before
Http::fake([
    'api1.example.com' => Http::response('Success!'),
    'api2.example.com' => Http::response(['data' => 'value']),
    'api3.example.com' => Http::response(status: 201),
]);

// After
Http::fake([
    'api1.example.com' => 'Success!',
    'api2.example.com' => ['data' => 'value'],
    'api3.example.com' => 201,
]);

  • Request::fluent() method
    The fluent() method lets you work with request data in a fluent way:

/** @var Illuminate\Http\Request $request */
$data = $request->fluent();

$data->name;
$data->email;
// etc.
  • PHP 8.4 compatibility updates and fixes.

New at SaaSykit

In modern web development, speed and responsiveness are king. A slow-loading website or application can be the difference between user satisfaction and frustration. Laravel’s defer() function is a new addition designed to address this by allowing you to perform background tasks effortlessly without affecting response times.

In this article, we’ll explore why defer() is a fantastic addition to Laravel and dive into practical use cases, complete with code examples.

Let’s get started.

From the Community

Most PHP developers are used to working with arrays when they are at the start or years into their programming career because they seem to be very simple to use.

Arrays however fall short when things get complex. It may seem like they are fine, but they do lack types and visibility.

There’s no way to know what the data inside of the array looks like or what each of the keys contain, what type the values are etc.

Perfectionism in programming can be both a curse and a gift. As developers, we often aim for perfect solutions and flawless code. But let’s be honest—sometimes, a good enough solution gets us further than striving for an unattainable ideal. Having worked with PHP for years and dabbled in Go for about a year now, I’ve found that PHP and GoLang each reflect different programming mindsets, and they each have their own ecosystems and philosophies.

Gates! The first impression it makes is “way to enter somewhere”. But, in reality, the primary responsibility of a gate is to prevent unwanted entry. Another perspective of thinking about gates is – different gates will take you to different places.

Laravel picked this word, “Gate” to name its basic authorization system. What a beautiful similarity between the purpose of an authorization system and the real life gates!

When structuring a database, similar relationships may repeat, like a Task may be assigned to a User, User Group, or User Role. Is it worth thinking about polymorphic? In this example, let's compare the performance and convenience to use.

Laravel Eloquent ist an object-relational-mapper, an ORM, that makes working with databases a joy. While you still need a basic understanding about your database and how writing queries works, Laravel Eloquent provides convenient methos to insert, update and query this data.

Eloquent uses the active record pattern where every column in the database table is accessible via a magic method of the related Eloquent Model. So you can access the name column of your user model with $user->name.

Laravel Debugbar is one of the most popular Laravel packages. It's mostly used for checking the SQL queries, but there are more features inside. Let's look at some of them.

When working with conditional data modifications in Laravel applications, the transform() helper provides an elegant solution. This powerful utility function enables selective data transformation while gracefully handling null values. Let's explore how this helper can streamline your data processing workflows.

Xdebug has a history of having a steep setup learning curve. I am here to show you that setting up Xdebug doesn't have to be painful. In fact, I am confident that you can start using Xdebug with Docker in about a minute.

OK, maybe it will take some of you a few minutes :)

We will demonstrate the setup with Laravel, PHP 8.4 and Xdebug v3.4.0, the latest stable versions at the time of writing.

Form validation in web applications requires careful handling of interdependent fields. Laravel's prohibited_if validation rule provides an elegant solution for conditionally restricting field inputs based on other field values. Let's explore how to implement this powerful feature in your applications.

All about SaaS

One of the most interesting things about ElevenLabs is that you're both a research and an application company, and one of the few vertically integrated players. Can you talk us through why ElevenLabs follows this approach compared to other companies who either just build models or applications?

You start with the research piece - figuring out a really hard problem. Then you realise later that it's not enough to build a good moat over time.

OpenAI and Anthropic have been driving a similar conversation. You can still be the best at the research side, but it gets to a point that research in the next 2-5 years will get commoditised in many ways with open source. The only option you have is working on a full end-to-end spectrum that enables you to build moats around yourself.

Alright, folks, it's that time of year again. The leaves are falling, the pumpkin spice is flowing (don’t you dare bring that shit in my house), and the 2024 SaaS Benchmarks Report just dropped (Source: HighAlpha). Grab your coffee (or your favorite adult beverage), because we're about to dive into some insights that might just change how you think about the SaaS landscape.

Hey — It’s Nico.

This is Behind Tactics 🧠, the Failory newsletter where I share the strategies behind the best startups.

This issue takes 6 mins to read. If you only have one, here’s what you need to know:

  • AI can transform e-commerce product pages, making them more detailed, engaging, and tailored to users, which improves both SEO and conversions.

  • Goldelucks increased orders by 31.56% with a simple AI-generated tweak to their product page messaging.

  • Personalization on product pages, powered by AI, is a promising idea that could make shopping experiences feel more personal and relevant.

  • Businesses like Varnish and Vine have seen significant revenue growth by using AI to optimize all their product pages.

  • AI-driven A/B testing helps e-commerce stores identify the best layouts, descriptions, and headlines, taking the guesswork out of content optimization.

When I started my growth career, I thought I was the only person responsible for the company’s growth. You bet I’d try my best to move those metrics. Being a junior, I thought it all came down to some magic tool, and all it takes - is to find it. With my mouth wide open, I listened to all these people talking at big conferences about a better way to approach some parts of growth. Almost shivering from excitement, I’d run to my laptop to try it out right after. It didn’t work.

The momentum of Thanksgiving — which saw consumers spend a record $33.6 billion globally online on the day — looks like it continued into Black Friday, with a bang. Adobe said that in the U.S., consumers made a record-breaking $10.8 billion of purchases, up 10.2% on last year. Meanwhile, Salesforce is giving a much higher overall spent estimate: $17.5 billion spent in the U.S., up 7% YoY. Globally, Salesforce said spending also reached a new high: $74.4 billion was spent in the 24-hour period, up 5% on a year ago. 

Having a dedicated landing page comparing your product or service to your competitor’s can function as a deal breaker for prospects who’re in the final stages i.e. bottom of the funnel of the buying process.

Well-optimized competitor comparison landing pages can achieve conversion rates ranging from 3% to 10%.

But it’s not just restricted to the potential customers who’ve moved to the bottom of the funnel but also folks who are aware of the players in the market and need more evaluation of these products or services side-by-side.


Videos

FASTEST Way to Learn Coding and ACTUALLY Get a Job

Fake Storage Count, HTTP Shorthand & Spell Ordinal Number Helper in Laravel 11.34

Scheduled Task Groups, Without Parents & Creating Models Quietly

Moving from Redis to SQLite with Mike Buckbee

12 Laravel Tips in 8 Minutes: November 2024

Keep building, keep rocking! 🤘

Psst, are you building a SaaS?

SaaSykit is a multi-tenancy Laravel-based boilerplate with everything you need to build an awesome SaaS.