SaaSykit Black Friday SALE, Laravel 11.31-11.33 released, PHP 8.4 released, and more!

Black Friday is here, and it's the perfect time to grab your SaaSykit copy! 😍

For a limited time, SaaSykit Complete is available at 25% off. Whether you're building a single-user platform or a multi-tenant SaaS, SaaSykit has everything you need to build your SaaS fast. This offer won’t last long.

Get SaaSykit now and turn your SaaS ideas into reality! 🚀

Use code BLACKFRIDAY2024 on checkout page to get the discount!

Laravel 11.31-11.33 are released 🚀

Laravel went ballistic in those couple of weeks and released 3 releases! Lots of useful features have been added. Here’s a quick summary of the main features, along with example code snippets.

  • Cache Token Repository
    Feature: Andrew Brown introduced a CacheTokenRepository for storing password reset tokens in the cache, offering an ephemeral alternative to database storage.
    How to use: Update the config/auth.php file:

'passwords' => [
    'customers' => [
        'driver'   => 'cache',
        'store'    => 'passwords',
        'provider' => 'customers',
        'expire'   => 60,
        'throttle' => 60,
    ],
    'users' => [
        'provider' => 'users',
        'table'    => 'password_reset_tokens',
        'expire'   => 60,
        'throttle' => 60,
    ],
],
  • Dynamically Build Mailers On-Demand
    Feature: Steve Bauman contributed Mail::build(), allowing dynamic mailer configuration:

use Illuminate\Support\Facades\Mail;

$mailer = Mail::build([
    'transport' => 'smtp',
    'host' => 'localhost',
    'port' => 587,
    'encryption' => 'tls',
    'username' => 'example',
    'password' => 'securepass',
]);

$mailer->send($mailable);
  • Add DB::build() Method
    Feature: Dynamically create database connections with DB::build():

use Illuminate\Support\Facades\DB;

$sqlite = DB::build(['driver' => 'sqlite', 'database' => ':memory:']);

$mysql = DB::build(['driver' => 'mysql', 'database' => 'mydb', 'username' => 'root', 'password' => 'password']);
  • Cache::build() for On-Demand Cache Repositories
    Feature: Dynamically configure cache repositories with Cache::build()

use Illuminate\Support\Facades\Cache;

$fileCache = Cache::build(['driver' => 'file', 'path' => storage_path('cache')]);
  • Middleware Priority Adjustments
    Feature: Append or prepend middleware priorities dynamically:

$middleware->prependToPriorityList(
    [\App\Http\Middleware\CustomMiddleware::class],
    \Illuminate\Routing\Middleware\ValidateSignature::class
);
  • URL::forceHttps() Method
    Feature: Enforce HTTPS for URLs with URL::forceHttps():

URL::forceHttps($this->app->isProduction());
  • createQuietly()
    Feature: Save a new model and return the instance without raising model events.

BlogPost::createQuietly()

And many more features like 8.4 compatibility, and a log of smaller fixes.

New at SaaSykit

As we gear up for the release of PHP 8.4 on November 21, 2024, it’s hard not to look back and appreciate how far the language has come. For those who’ve been around since the days of PHP 5 or even earlier, each new version feels like a reunion with an old friend who’s grown in ways you never expected.

And PHP 8.4? It’s a big one. Lots of exciting new features that I personally can't wait to use in my projects!

Let’s take a look into those!

If you’ve ever had the nerve-wracking experience of accidentally editing live data while developing locally, you’ll understand why I created Filament Oops, a Laravel package to protect developers from mistakenly modifying their production environment.

From the Community

Have you ever come across a problem when you have checkboxes and that checkboxes let you filter a category for your product, but it is nested, like above?

Thinking about this problem, this should have been easy logic-wise, right? But it’s not as easy as we think when we are developing the feature on Livewire. So, this problem just came across me yesterday, and I spent a few hours thinking how to solve this problem the easiest way. Here, I will share how I solved it.

One of the more challenging aspects of being a professional programmer is spending the majority of the day immersed in code, trying to maintain a mental construct of what I’m building.

As the projects I work on have grown, I realized that it’s impossible for me to grasp all of what is going on in the application at once. I don’t have enough RAM!

Let's build a tiny template engine for PHP!

This post will focus on rendering the template and echoing out data that can be escaped with htmlspecialchars().

Before we start writing code we need to take care of the most important part of any programming project — giving the project a name. I'm going to call it Stencil.

The templates themselves will all be plain PHP. We won't be creating any special syntax like Twig or Blade, we'll focus solely on templating functionality.

PHP 8.4 is scheduled to be released tomorrow, and one exciting feature we haven't covered yet is Asymmetric Property Visibility. Starting in PHP 8.4, properties may also have their visibility set asymmetrically with a different scope for reading and writing. Here's an example from the documentation

PHPStan just released v2.0.0 this week! This massive update is three years in the making, consisting of over 180 items in the release. Creator Ondřej Mirtes had this to say about the release of PHPStan 1.0 over three years ago and now releasing 2.0:

Text-based User Interfaces (TUIs) are gaining popularity in the Laravel ecosystem, thanks to the powerful capabilities of Laravel Prompts. Developers are leveraging this technology to create innovative TUIs for a variety of tasks. One such tool is Solo for Laravel, a versatile TUI developed by Aaron Francis.

Solo is a package that allows you to run multiple commands at once, to aid in local development. With Solo you can have all the commands needed to run and monitor aspects of your application behind a single command:

In recent years, the serverless paradigm has become known as a transformative approach to application development, allowing us to focus more on writing code and less on managing infrastructure.

Laravel Vapor, a serverless deployment platform for Laravel applications, brings the power of the Laravel framework into the world of serverless architecture. By integrating Laravel with Lambda and other AWS services, Vapor offers a simple way to build, deploy, and scale applications without the complexities of traditional Linux server management. After your initial setup, your application will behave like it was deployed traditionally - the serverless setup is abstracted away from the user.

When handling images in your Laravel applications, you may sometimes be required to edit them. This could include resizing, cropping, or converting images to meet a given criteria. For example, you may want to crop and resize all user avatar image uploads to a fixed-sized square.

In this article, we'll examine how to use the Intervention Image (intervention/image) package in Laravel to edit images. We'll cover common tasks such as reading, storing, resizing, cropping, rotating, converting, and watermarking images.

All about SaaS

90% of Startups Fail because of Team Issues

Admittedly, we recycled the headline from a DDVC post earlier this year about how to use social media posts to predict founder personality trade. But it equally fits today’s episode as we dive into team dynamics in founding teams.

Those individuals roll up their sleeves and take the company from 0 to 1, tackling the challenges of building something entirely new. But as a startup evolves, so does the team.

Roles and responsibilities shift, and in many cases, even the people sitting around the table may change. According to research and recent studies, turnover in founding teams is more common than you might expect, and knowing how to navigate these changes is key to long-term success, and making sure you’re one of the 10% of survivors.

Last year, I helped a former consulting colleague prep for an operating partner interview at a PE fund here in Chicago. Good news: He got the job and is loving the work. We caught up recently and got to talking about how strategy changes when you’re working with smaller companies. After our conversation, he sent me this article - Victor Cheng's The Deep Flaw in MBB Strategic Planning - about how small companies get stuck trying to “do strategy” like big companies. It’s a fantastic read, and tees up a couple important questions:

Last week, I watched Netflix’s new documentary on Martha Stewart. My takeaway: Martha Stewart was, in many ways, the first influencer.

Stewart got her start in the 1980s when she published her first cookbook, Entertaining, which quickly became a bestseller. She parlayed that success into more books, and then into the magazine Martha Stewart Living, launched in 1990 with TIME. By 1995, the magazine had a circulation of 1.5M copies. Around the same time, Stewart launched her syndicated TV show of the same name, reaching 90M American homes.

You are a pharmaceutical company who has blown through a billion dollars of research and development, only to produce a drug that doesn’t work. But you want to get it approved by the FDA1 anyway so you can recoup that cost, hapless consumers be damned2 .


Videos

Web Scraping 101: How To Scrape 99% of Sites

Laravel's New Cache Token & Dynamic Build Features in v11.31

Resolving Dependencies Helpers

So We Tried to Build a Project with Livewire vs Vue vs React... (showdown)

Laravel API Security: Triple-Check Request TYPES (example "hack")

13 Laravel Tips in 10 Minutes: October 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.