Category: PHP

Laravel Snippets PHP

Snippet 4: How I autoload my helper functions

I used to just load a helpers.php file in composer.json like everyone else, however the last couple years I have taken a more organizational approach.

Anthony Rappa Anthony Rappa

Anthony Rappa

2 min read

Blade Laravel PHP

Working with @blade $loops

Everyone knows about looping data in Blade files, but have you seen these lesser known features?

Anthony Rappa Anthony Rappa

Anthony Rappa

2 min read

Community PHP

Why we need multi-line short closures in PHP

PHP 8.1 is already taking shape quite well, yet there's one feature I'd love to see added, that's still being discussed: multi-line short closures.

53 clicks

Community Laravel PHP

Defining Default Password Validation Rules in Laravel

In Laravel 8.43, the Password Validation Rule Object now supports the ability to define default password rules you can use across your application.

120 clicks

Alpine Livewire Laravel Javascript Blade PHP

Embracing the love between Livewire and Alpine

Building with new tools is hard, especially when it goes against what you've learned about the client and server in the past. Livewire and Alpine are built for each other and here's how you make the most of that relationship.

Anthony Rappa Anthony Rappa

Anthony Rappa

8 min read

Community PHP

A package to watch for file system changes in PHP

The Spatie team has released a new package called file-system-watcher. As the name implies, this package can watch changes in the file system and let you act on those changes.

67 clicks

Community PHP Laravel

Find N+1 problems instantly by disabling lazy loading

In the next release of Laravel 8, you can strictly disable lazy loading entirely, resulting in an exception.

66 clicks

Laravel Livewire PHP

Building a like button component with Laravel Livewire

Follow along as I create a reusable like button in Laravel Livewire that restricts clicks per IP address.

Anthony Rappa Anthony Rappa

Anthony Rappa

6 min read

Community Laravel PHP Eloquent Database

Laravel one-of-many relationships

This pull request to the Laravel framework provides a solution for creating one-to-one relations that are a partial relation of a one-to-many relation.

87 clicks

PHP Laravel Snippets

15 Random Laravel Snippets & Methods

I write code blocks down that I know I won't use often and will forget about. Every so often I go through them to refresh my memory.

Anthony Rappa Anthony Rappa

Anthony Rappa

2 min read

Community Laravel PHP

Laravel Octane v1.0 is Here

The Laravel team has been hard at work on Laravel Octane, a tool to supercharge your Laravel application's performance. After releasing the beta in April, Octane has released a stable 1.0 version!

91 clicks

Community Laravel PHP Tailwind

Simple Automatic Upgrades for Tailwind CSS with Shift

On Monday Shift officially released Tailwind Shifts for upgrading Tailwind projects all the way back to Tailwind 0.x.

91 clicks