freek.dev newsletter #175

Hi there!

Welcome to the 175th freek.dev newsletter!

Here are a couple of links I hope you'll enjoy as much as I did.

Handling email testing in Laravel with Ray
Learn how to use Ray to test emails in Laravel!

Fun with Blade directives
Some fun things you can do with Blade directives.

Supercharge Your Money with the Financial Router Sequence (sponsored link)
Sequence, the world's 1st Financial Router, connects all your bank accounts, credit cards, savings, and investments on an intuitive money map. Create automations with smart rules and IF statements, and execute your strategy directly from the platform to manage your finances.

Some cool SQLite things
Just a small post about some of the cool things you can do / see in SQLite.

Assigning a user to an error
Learn how you can assign a user to an error in Flare!

Architecture Testing in Laravel with Pest
Read about how to use Pest to add architecture tests for your PHP application and enforce standards such as folder structures, naming conventions, and more.

I write my code in the controller
A pragmatic approach to avoiding early optimizations

Building Maintainable PHP Applications: Thinking Data vs Thinking Business Processes
Learn about the differences between thinking in terms of data (CRUD) vs thinking in terms of business processes (behaviour) and how it affects code maintainability.

Laravel Under The Hood - The Strategy Pattern
Have you ever wondered how Laravel switches between different drivers' implementations? Well, hang tight, we will learn how!

Primitive Obsession: what it is, how to spot it and, how to fix it!
Explains what the Code Smell 'Primitive Obsession' is, the damage it can cause to your codebase, how to spot it and - how to fix it!

Encrypting Queued Jobs, Notifications, Mail, and Listeners in Laravel
Read about how to encrypt queued jobs, notifications, mailables, and listeners in Laravel for improved security.

Optimizing PHP for performance
Let's dive on how to enable OPCache and fine-tune php-fpm to handle the most requests as possible on a given machine.

Form Validation with Type Inference Made Easy with Zod, the Best Sidekick for TypeScript
Let's explore Zod: a library that can help us validate data not only on the client but also on the server, and even generate TypeScript types to maintain end-to-end type safety and consistency.

Disabling Composer's default timeout inside of scripts
Composer's 30 second execution timeout can get in the way of long-running processes executed from a script. This is how you disable it.

vue-ray 2.0 is out - full Vue 3 composition api support
The vue-ray package has released v2.0, with full script setup/composition api support, reduced overhead, and more.

Elevate Your Laravel Eloquent Queries with Tappable Scopes
Use tappable scopes in Laravel to break down complex queries into reusable pieces without needing to use magic query scopes in Laravel.

How Ahrefs Gets a Billion Dollar-Worth Infrastructure With a 90% Discount
Choosing colocation for the infrastructure was the right decision for Ahrefs.

Protecting your email address via SVG instead of JS
A nice technique to prevent simple bots from harvesting your email address.

How to build a writing habit
A wonderful essay by Peter Suhm

How we stopped a DDoS attack at Laracon
Discover how we stopped a DDoS attack at Laracon!

How to create Wireables in Livewire?
Learn how to use objects like Data Transfer Objects in Livewire with Wireables.

Clearing Ray output
Learn how to clear your Ray window whenever you want so that only the most recent output is displayed.

Rethinking deploys at Flare
We now use GitHub actions to deploy our application

How to Refactor a Method With Optional Params
Read how I fixed performance issues when refactoring and optimising legacy code with method signature inconsistency, done unintentionally by developer

Pausing and disabling Ray execution
This is one of Ray's coolest features!

Working with DynamoDB in Laravel
Learn about how to use DynamoDB in Laravel for caching and storing Laravel models.


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

Why Are My Tests Failing? (submitted by Ash Allen)

Why to use Custom Exceptions in PHP (submitted by Wendell Adriel)

Using LEMP stack on Ubuntu to host a Laravel app (submitted by Goran Popović)

Saving data without triggering events in Laravel (submitted by Bert De Swaef)

Generate a Laravel CRUD (Create, Read, Update, Delete) in 5 minutes. (submitted by Karan Datwani)

How to make Laravel Reverb work on Laravel Forge (submitted by Tony Masek)

Laravel Under The Hood - Extending the framework (submitted by Oussama Mater)


Old posts

Here are a couple of links from a while ago!

Improving Client Side Pagination with Livewire

Let's build a ChatGPT Plugin with Laravel

Generating Large ZIP Exports From Files in S3

A Laravel package to quickly see which HTML is rendered by which Blade view


Did you like this newsletter?

I take a lot of time curating the right links for you. You could do me a favor by either spreading the word and letting others know about my newsletter.

Alternatively, you could consider picking up one of the paid products my team and I have worked on:

  • All spatie products
  • Oh Dear
  • Mailcoach
  • Flare

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 freek.dev Unsubscribe from this newsletter This mail was sent using Mailcoach

Online version • Past editions • Unsubscribe