Hi there!

Welcome to the 151st freek.dev newsletter!

It's been another busy month. Our team and I released Laravel Comments, a premium package
to enables you to add a cool commenting functionality to your Laravel app in now time. And next
to that we released two new packages. We've also hit the 300 million downloads mark
which is pretty crazy.

Now that I'm only sending my newsletter once a month, there are some more links than usual.
Have fun going through all this content!

⭐️ A package to add comments to your Laravel app
Our team has released a new premium package called Laravel Comments. Using this package, you can set up a comments section in your Laravel app in no time. We've made a nice, errr I mean epic launch movie to get you in the right mood. Laravel Comments includes a Livewire…

⭐️ Using login links in a Laravel app
I'm proud to announce that our team has launched a new package called spatie/laravel-login-link. In this blog post, I'd like to tell you all about it. What is a login link, and why should you use it? When developing an app with an admin section (or any non-public section), you'll likely seed test…

⭐️ A package to create Livewire powered wizards in no time
Here's another cool package that our team has released. It is called laravel-livewire-wizard. Using this package, you can set up multi-step wizards quickly using Livewire. The package is headless, which means that it provides no UI itself, but it makes it easy to build any UI you desire.

⭐️ How to add a spotlight-like search field to your Laravel app
As developers, we tend to like shortcuts to speed up our workflow. One of the tools I'm using to speed up doing stuff on my Mac is Raycast. It offers a lovely command palette that allows opening apps and URLs, working with clipboard history, and much more. Wouldn't it be nice to also add such a…

Restructuring a Laravel Controller using Services, Events, Jobs, Actions, and more
Laravel gives you the flexibility to choose the structure of controllers yourself, which is both a blessing and a curse. You won't find any recommendations in the official Laravel docs, so let's try to discuss various options, based on one specific example.

Creating your own color system with Tailwind
In this post, Oh Dear's front end developer Nick goes into more detail on why and how he implemented a tailwind-like color system that will be used in the upcoming redesign.

35 Laravel Eloquent tips
Martin Joo shares some cool things you can do with Laravel's ORM.

The Gambler's Ruin, Illustrated with PHP
Jeffrey Way of Laracasts demonstrates what the Gambler's Ruin is using PHP.

Laravels Command Bus
In Laravel 5.1 the Command Bus was replaced with Dispatchable Jobs, we can still use them but let us also look at how to add a Command Bus.

Building Oh Dear’s new design: Implementing the design
Here's a new blog post by our designer Nick on how he's revamping the looks of Oh Dear.

Using Request Factories for Gorgeous Feature Tests
A cool new package made by Luke Downing

What's new in Tailwind 3.1
Adam shows the cool new stuff!

How to send e-mails in Laravel with Tailwind CSS
In this tutorial I'll show you how to send e-mails from Laravel with Tailwind CSS. I'll learn you how to set this up and how to inline all the Tailwind CSS-classes.

Bringing page transitions to the web
Here's a cool feature the Chrome team is working on. It's already available in Canary.

Adapter Pattern in PHP
Of all of the design patterns you could use in your code, the adapter pattern is one of my all time favourites. It allows you to abstract the implementation to an adapter that implements an interface. so you can switch implementation simply by switching the adapter.

Testing API responses in pestPHP
I get asked about API response testing a lot, how should you do it, and where to start. I have a general rule when it comes to testing APIs, and that rule is: "test your code, and your code only". What do I mean by this? Let me explain:

Extensible Blade Components
In this post, Marcus explains the fundamentals of Blade components. A great introduction or review, this post walks you through the process of creating an extensible button component that contains the code common between button types, with additional interactivity powered by Alpine.

Creating Dynamic HTML Tooltips with Alpine and alpine-tooltip
After integrating Tippy into a few projects with Alpine.js, I decided to write my own plugin to make the integration easier and the API a little nicer (x-tooltip and $tooltip).

Use Laravel's HTTP Client with Facebook's Business SDK
Ever needed to work with an SDK and wished you could use Http::fake() in your Laravel tests? This blog post explains how you can achieve this for the Facebook Business SDK using the Adapter pattern.


Community links

In this section you'll find links submitted by others.
Let me know if you did write or stumbled across a blog post, tutorial or video that might be interesting to appear in this section


One way to work with money in PHP/Laravel (submitted by Barbora Juhasova)

How to use a local MinIO S3 server with Laravel, and automatically configure it for your Laravel Dusk test suite (submitted by Pascal Baljet)

Laravel & React Native File Upload (submitted by Khalil Bouzidi)

A better UX for Laravel Cashier (submitted by Yoeri)

Deploy Laravel Application to Amazon Lightsail (submitted by Harun R)

Testing your Statamic implementation (submitted by Yoeri)

Logging to the database with Laravel (submitted by Yoeri)


Old posts

Here are a couple of links from a while ago!

CSS cascade & specificity

How to optimize ORDER BY RANDOM()

Dealing with the n+1 problem in Laravel

Performance problems caused by array_unique

How Laravel handles DB connections

A new design for Ignition

PHP Short Functions and Scope

Using Laravel's parallel testing inside your package tests

Improve code readability by refactoring if blocks to dedicated classes



If you have any questions, remarks or thoughts about this newsletter, simply hit reply!
Thank you so much for reading!




Freek

You are receiving this newsletter because you subscribed at https://freek.dev
Unsubcribe from this newsletter
This mail was sent using Mailcoach