Ash Allen

Ash Allen

@ashallendesign.co.uk

๐Ÿš€ Freelance Laravel Web Developer and Blogger โšก https://battle-ready-laravel.com ๐Ÿ”ฅ https://consuming-apis-in-laravel.com โœจ https://web-dev-freelancing.com

1.4K followers82 following366 posts

๐Ÿ”ฅ In PHP, you can use the "set" property hook to validate a value before setting it! Have you used property hooks in your PHP projects yet? Here's a simple example of only allowing an enum property to be set to specific enum cases:

I've just made a PR to Laravel! โšก It proposes a new "Via" attribute which could be added to notification classes. It can be used to define hardcoded notification channels without requiring a "via" method. Is this something you'd use if it were merged? ๐Ÿ˜„

โšก As of Laravel 13.4.0, you can use "FormRequest::failOnUnknownFields" to enable errors which will be thrown if unknown fields are passed in requests! Is this something you think you'd use in your own projects? ๐Ÿ˜„

Thanks for sharing this! I'm still super proud of this book. I've got it open on my desk most days so I can refer back to it ๐Ÿ˜„

MadeWithLaravel@madewithlaravel.com

Learn how to confidently integrate third-party APIs in your Laravel projects using maintainable & testable code with this eBook by @ashallendesign.co.uk ๐Ÿ“– - madewithlaravel.com/consuming-ap...

โšก You can use the "once" helper to memoise data in Laravel! The result of the closure will be stored on the first call. Then all future calls will return the stored result. When used in the right places, this can lead to some nice performance gains.

I've just finished writing an article about memoisation in Laravel which covers: ๐Ÿ‘‰ Using the "once" helper ๐Ÿ‘‰ Using "once" in methods and static methods ๐Ÿ‘‰ How "once" is handled in Octane apps ๐Ÿ‘‰ Alternatives to "once" Hoping to publish it on Monday ๐Ÿ˜„

My latest freelance contract has just come to an end this week. So I'm now available to take on new Laravel projects/work! If you're on the lookout for a Laravel dev with plenty of experience, feel free to give me a shout! ๐Ÿ˜Ž

๐Ÿ”ฅ If you're using job batches in Laravel, the "job_batches" database table can grow quite quickly. To solve this, you can schedule the "queue:prune-batches" command. I've just added this to @findapr after I noticed the table contained a ton of old rows (approx 28k rows) ๐Ÿ˜„

What level do you run PHPStan at in your projects? I've personally found level 5 or 6 to be the sweet spot (especially when adding it to existing projects) ๐Ÿ˜„

I've just hit a mini-milestone with my Email Utilities package: It's crossed 100 stars on GitHub! โญ It's really close to hitting its first 1,000 downloads, too. I've just checked and it's been installed 995 times ๐Ÿ‘€

I've just released Email Utilities for Laravel v1.1.0! ๐ŸŽ‰ This release includes: โœ… Artisan command that can be used to update the disposable domain list (shown in the screenshot) โœ… Caching to improve performance โœ… An updated list of disposable domains (4932 domains!) [1/2]

The PR didn't get merged! But I'm planning on writing an article soon to show how you can use Mailtrap for: ๐Ÿ‘‰ Sending single emails in Laravel ๐Ÿ‘‰ Sending bulk emails in Laravel ๐Ÿ‘‰ Testing Laravel emails using Mailtrap sandboxes Aiming to publish it next week ๐Ÿ˜„

Ash Allen@ashallendesign.co.uk

I've just made a PR to Laravel to propose first-party support for sending transactional email with Mailtrap! Is this something you might use? ๐Ÿ˜„ ๐Ÿ‘‰ PR: github.com/laravel/fram...

I want to say a huge thank you to Mailtrap for sponsoring me on GitHub! ๐Ÿ˜„๐ŸŽ‰ I've been using Mailtrap for a few years for email testing, and it's always been a great platform. So it's really cool that they're now sponsoring me! Thanks! ๐Ÿฉต

When registering for a new website/app, do you prefer to use social sign-ins (e.g., "Sign in with Google") or stick with traditional email and password authentication? ๐Ÿค”

As of Laravel 12.36, you can use the "File::allDirectories" method to get an array of all nested directories (including nested directories) within a given path ๐Ÿ”ฅ