Laravel Bytes

Welcome to the home for Laravel-oriented content on Fly.

By Chris Fidao

Parsing Recipes With Robot Help

This is NOT a story about how Javascript stole 2 hours of my life, and PHP rescued me - in 6 minutes. That did happen, but I digress. The real story is: Recipe sites are bloated. Rumor has it that this is because you can't copyright a recipe, but ...

Read more about Parsing Recipes with Robot Help
By Johannes Werbrouck

Console Applications With Laravel Zero

Here's a news flash: You can write console applications with Laravel! Actually, it's kinda with Laravel and kinda without. Let's take a closer look at Laravel Zero and some cool things you might want to know about! Support for FacadesFirst off: t...

Read more about Console Applications with Laravel Zero
By Kathryn Anne Tan

Creating a Middleware to Globally Log Submissions in Livewire

Ever implemented logic that applied to multiple Livewire components? Why not use a middleware to make it available across Livewire components? For example: Imagine having two Livewire components that handle two different form submissions. If, say,...

Read more about Creating a Middleware to Globally Log Submissions in Livewire
By Chris Fidao

Prometheus Metrics in Laravel

It's almost a hidden feature - Fly.io provides Grafana dashboards with helpful metrics for all of your Fly.io apps. All you have to do is head to https://fly-metrics.net/. 👉 Here's the kicker: If your app publishes some metrics, Fly.io will read ...

Read more about Prometheus Metrics in Laravel
By Kathryn Anne Tan

Sharing Google Maps Data Across Separate Livewire Components

Let's say we have separate Livewire components for: A Google Map Element - an interactive map for adding and deleting location markers A Search box Element - to re-focus the Google Map element to a user given location A Drop Down Element -...

Read more about Sharing Google Maps Data across Separate Livewire Components
By Johannes Werbrouck

Invoice PDF Generation With Browsershot

Invoicing is a hugely important part of any business. By having your Laravel app generate invoices automatically, you can make the life of your users a lot easier and we all know that means they'll hang around longer and be more keen to use your a...

Read more about Invoice PDF generation with Browsershot
By Johannes Werbrouck

Cost-Effective Queue Workers With Fly.io Machines

Fly.io machines have been announced and have been made the default way new apps will be run on Fly.io's platform. They have many advantages, and one of them is their super-fast boot times. In this article, I'll show you how to use machines to run ...

Read more about Cost-Effective Queue Workers With Fly.io Machines
By Chris Fidao

Tricks for Running Commands With Laravel Process

Laravel 10 has released the Laravel's Process facade, which make running external commands super easily. $result = Process::run("php -v"); echo $result->output(); This uses Symfony Process under the hood, and adds a TON of quality-of-life improv...

Read more about Tricks for Running Commands with Laravel Process
By Kathryn Anne Tan

No-Upload, Batched Import of Data With SheetJS CE and Livewire

When we think about first steps in importing spreadsheet data, we usually think of uploading the file first to the server, before processing the import. But. What if we didn't need to upload the file at all? In this article, we'll import data from...

Read more about No-Upload, Batched Import of Data with SheetJS CE and Livewire
By Chris Fidao

Figuring Out SPAs

SPAs always are a bit fragile. Nevermind the game of "where's the business logic?" (a rant I won't bother writing), splitting the frontend from the backend makes hosting SPAs harder. The complications are mostly related to security concerns, such ...

Read more about Figuring out SPAs
By Kathryn Anne Tan

Collecting Time Video Metrics With Livewire

Alright drumrolls. Because today, we'll intercept three user-video interaction events, and use Livewire to easily send event data to our server! The ProblemThere are cases when we'd want to get insight on how users interact with the video files w...

Read more about Collecting Time Video Metrics with Livewire