• Makers Make by SaaSykit
  • Posts
  • Laravel 11.35/36 released, Inertia v2.0, Laravel VS Code Extension, Learn Laravel by Exploring Open-Source Projects & more

Laravel 11.35/36 released, Inertia v2.0, Laravel VS Code Extension, Learn Laravel by Exploring Open-Source Projects & more

Laravel has been on a roll recently, dropping Inertia v2.0, Laravel VS Code Extension (public beta) and in addition two releases back-to-back: 11.35 and 11.36! šŸ¤Æ

In addition, the new Laravel updates are packed with exciting features.

Here's a quick overview of the standout features, complete with example code snippets to help you dive right in. šŸ‘‡

Laravel 11.35/36 released šŸš€

Hereā€™s a concise summary of the Laravel 11.34 updates

  • URI Parsing and Mutation
    Taylor Otwell introduced a Uri class for intuitive URI parsing and manipulation:

$uri = Uri::of('https://laravel.com')
    ->withQuery(['ref' => 'newsletter'])
    ->withPath('/docs/getting-started')
    ->withFragment('examples');

echo $uri->query()->get('ref'); // "newsletter"
echo $uri->path(); // "/docs/getting-started"
echo (string)$uri; // "https://laravel.com/docs/getting-started?ref=newsletter#examples"
  • Retrieve a Uri instance from routes or requests:

$uri = Uri::route('docs.show', ['section' => 'installation']);
  • Disable or Customize HTTP Exception Message Truncation
    Steve Bauman enabled customization of truncated HTTP exception messages:

use Illuminate\Foundation\Application;

return Application::configure(basePath: dirname(__DIR__))
    ->withExceptions(function ($exceptions) {
        $exceptions->dontTruncateRequestExceptions(); // Disable truncation
        // Or set a custom length
        $exceptions->truncateRequestExceptionsAt(300);
    })->create();
  • Transform HTTP Response to Fluent Instances
    HTTP responses can now be directly converted to a Fluent object:

$response = Http::get('https://api.example.com/products/1')->fluent();

echo $response->float('price'); // 299.99
$response->collect('tags')->each(fn ($tag) => echo $tag);
  • Chainable set() Method in Fluent Class
    A new set() method allows setting deeply nested attributes in Fluent instances with dot notation:

$fluent = new Fluent;

// Set basic attributes
$fluent->set('product', 'iPhone')
       ->set('version', 15)
       ->set('developer', 'Apple');

// Set nested attributes with dot notation
$fluent->set('specs.color', 'Space Black')
       ->set('specs.storage', '256GB')
       ->set('specs.price.usd', 1199);

// Retrieve values
echo $fluent->product; // "iPhone"
echo $fluent->specs['color']; // "Space Black"
echo $fluent->get('specs.price.usd'); // 1199
  • Conditionable Trait in Requests

    Ahmet Imamoglu added the Conditionable trait to HTTP requests for flexible handling:

protected function prepareForValidation(): void
{
    $this->when(
        $this->input('user_id'),
        fn ($request, $userId) => $request->merge(['username' => User::find($userId)->name]),
        fn ($request) => $request->merge(['username' => 'Guest'])
    );
}
  • Sort Routes by Definition

    Sort route:list by definition for easier management:

php artisan route:list --sort=definition
  • Enhanced Schedule Handling with Conditional Pings

    Luca Castelnuovo introduced pingOnSuccessIf and pingOnFailureIf for conditional task pings:

Schedule::command('backup:run')
    ->pingBeforeIf($isEnabled, $pingUrl . '/starting')
    ->pingOnSuccessIf($isEnabled, $pingUrl . '/success')
    ->pingOnFailureIf($isEnabled, $pingUrl . '/failure');

New at SaaSykit

For developers starting their journey, getting practical experience can be a chicken-and-egg problem. Without hands-on exposure to real projects, itā€™s difficult to build the skills needed to land opportunities. Yet, without those opportunities, gaining experience feels impossible. This is where open-source projects become a godsend. 

By exploring and contributing to these projects, you not only learn how professional applications are built but also get a chance to see how seasoned developers solve real-world problems.

Even for experienced developers, exploring open-source projects can be incredibly valuable. These projects offer a chance to see diverse coding styles, learn advanced techniques, and discover innovative ways of solving complex problemsā€¦

From the Community

We're excited to announce the stable release of Inertia 2.0, bringing significant improvements to how you build software with Laravel. This release is part of our continued investment in making the frontend development experience with Laravel as productive and enjoyable as possible.

VS Code has firmly established itself as the go-to editor for developers worldwide. While PHPStorm seems to be the preferred choice for Laravel developers, many, especially those transitioning from other languages, are comfortable and would prefer to do Laravel development in VS Code.

There is some Laravel support in VS Code through various extensions, but a truly seamless and integrated experience was missing. Recognizing this need, at Laracon US 2024 the Laravel core team announced the ambitious task of creating an official VS Code extension for Laravel. The wait is finally over, as the public beta is now available.

In modern PHP development, attributes provide a structured way to add metadata to classes, methods, and properties. Both Laravel and Livewire have embraced this feature, introducing several attributes to streamline common tasks. Let's explore the PHP attributes provided by Laravel's Container and Livewire, along with examples for each.

In this example, Iā€™ll illustrate how Facades and Laravelā€™s Service Container work together.

Letā€™s assume we have a Twitter class that accepts a token in its constructor and includes a method named tweet.

One of the fun parts of doing my security audits is coming across unexpected code that looks exploitable, and trying it out myself to see what possibilities exist.

Laravel's custom casts enable tailored data transformations, extending beyond built-in casting capabilities to handle complex data types and business logic.

Here is an example of using a phone number formatter using custom casts:

All about SaaS

Think of your competitorsā€™ ads as an open book. Theyā€™re publicly available, offering you a peek into their messaging, creatives, and strategies.

Now imagine being able to read that book anytime you want, for free!

Thatā€™s the offering of ad libraries. And Meta ads took it up a notch by creating the most user-friendly ad library with advanced filtering features.

Meta ad library, previously known as Facebook ad library, is a powerful yet underrated resource that performance marketers often overlook. By offering full transparency, it allows you to view Meta ads of all businesses running across Facebook, Instagram, Messenger, and Audience Network, alongside their performance summary.

To get into the hottest deals, VCs must offer value beyond capital. We talked to leading VCs about how they stand out when pitching a founder. Hereā€™s what they had to say.

Recently, noted VC Marc Andreessen kicked off a discussion about debanking, in a podcast with his co-founder Ben Horowitz (begins at 7:42) and in an appearance on Joe Roganā€™s podcast. The venture firm they founded, a16z, also published a brief on this topic.

The central thrust, quoting a16zā€™s brief (ellipsis in original): ā€œDebanking can therefore be used as a tool or weapon systemically wielded by specific political actors / agencies against private individuals or industries without due process. Imagine if the government decided who could or couldnā€™t get electricity merely because of their politics, or some arbitrary reasonā€¦ without having to explain, notify, or offer recourse. Thatā€™s whatā€™s happening with debanking.ā€

If we were to put the question to you, ā€œwhat is a great business?ā€, how would you answer?

Would you hone in on financial characteristics like high cash flow conversion and recurring revenue, or would you point to a competitive advantage that creates a ā€œmoatā€ or a very savvy manager? Do great businesses exist where there is still keyman risk? Or does the very fact that a single person is critical to the business suggest the business isnā€™t ā€œgreatā€?

If every business in an industry like credit ratings or salvage vehicle auctions has a high ROIC, does that mean the industry is great and not the companies? If an oil company owns a prodigious well, youā€™d be more prone to say they have a great asset and not necessarily a great company. However, if a company owns incredible IP, like Nintendo, would you say itā€™s a great company even if monetization of that IP was historically underutilized? Can a great company have no reinvestment opportunities?


Videos

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.