Posts tagged with spatie

Selling digital products using Laravel part 1: Intro + a tour of spatie.be

by Freek Van der Herten – 5 minute read

On our Laravel powered company website we sell digital products: video courses, e-books, and software packages. Behind the scenes we use Laravel, Paddle, Vimeo, the GitHub API and a couple of other things.

We've open-sourced our site. You'll find the actual code we have deployed in the spatie-be repo on GitHub. In this blog post, I'll guide you through the code.

Read more

Selling digital products using Laravel part 5: Using Satis to install private packages

by Freek Van der Herten – 7 minute read

Some of our products, like Mailcoach and Media Library Pro, are PHP packages for which people can buy a time-limited license. Of course, we want customers to be able to install our paid packages using Composer. Our paid packages are not registered on Packagist, because Packagist is meant to be used for free packages, and there's no way to handle licenses. Let's take a look at how we can solve this using Satis.

Read more

Join thousands of developers

Every two weeks, I share practical tips, tutorials, and behind-the-scenes insights from maintaining 300+ open source packages.

No spam. Unsubscribe anytime. You can also follow me on X.

Why and how you should monitor scheduled tasks

by Freek Van der Herten – 10 minute read

Oh Dear is the monitoring SaaS that my buddy Mattias and I are running. As you might suspect, our service can monitor the uptime of sites and SSL certificates' health. What sets Oh Dear apart from the competition is that it can also monitor performance and detect broken links and mixed content on any of the pages of your site.

Today, we added a new type of monitoring: scheduled tasks monitoring. Oh Dear can now notify you whenever one of your scheduled tasks has not run or is running too late.

You can get started monitoring your schedule today. We have a free ten-day trial. And when using this coupon code, you'll get 30% off on the first three months when subscribing: MONITOR-ALL-THE-THINGS.

In this blog post, I'd like to introduce how you can use scheduled task monitoring in Oh Dear, and how it works under the hood. There were a lot of interesting challenges we had to solve. I hope you're ready to dig it.

Read more

How to delete 900 million records in MySQL without shooting yourself in the foot

flareapp.io

When reviewing the contents of the database of Flare, we encountered a table with 1 billion records. Technically that isn't a problem. Flare runs on Vapor and uses an Aurora database, so it can handle that scale. But of course, there's a cost for storing that many records.

We dove in and concluded that we could safely delete about 900 million records. They all were created before a specific date.

Read more [flareapp.io]

How to call an overridden trait function

by Freek Van der Herten – 3 minute read

Traits are a wonderful thing in PHP. You can use them to reduce code duplication by putting common functions in a trait and apply them to all classes where those functions are needed. I also sometimes use traits to break up a large function in multiple single-use traits.

In this post, I'd like to show you how you can override a trait function and call it from the overriding function.

Read more

How to group queued jobs using Laravel 8's new Batch class

by Freek Van der Herten – 14 minute read

Laravel 8 offers a shiny new way to group multiple jobs into one batch. This will allow you to easily check how many job there are in a batch, what to total progress is and even cancel all jobs in a batch.

In this blog post, I'd like to share how we will use this feature in the upcoming v3 of Mailcoach. We'll also take a look at how batches are implemented under the hood in Laravel.

Read more

Introducing Laravel Schedule Monitor

by Freek Van der Herten – 12 minute read

Since version 5, Laravel has a built-in scheduler to perform tasks at regular intervals. In normal circumstances, these scheduled tasks will run just fine.

Out of the box, Laravel doesn't offer a way to see the status of the scheduled tasks. When did they run, how long did a task run, which tasks did throw an exception?

Laravel Schedule Monitor is a new Spatie package that monitors all schedule tasks in a Laravel app. In this blog post, I'd like to introduce the package to you.

screenshot

Read more

Announcing the Laravel Beyond CRUD video course and book

by Freek Van der Herten – 4 minute read

I'm proud to announce our team is creating a new video course called Laravel Beyond CRUD. In this course, you'll learn various patterns to build a large scale Laravel app with your team. Even if you're not working on large Laravel apps, there are lots of things to learn to improve your projects.

This course will be offered as a premium video course, and as a book. The course will be presented by Brent, who is in the lead at various large scale client projects at Spatie. The book, also written by Brent, is beautifully designed by my colleague Seb.

At the Laravel Beyond CRUD website, you can subscribe to our email list. We'll notify you as soon as the course is available in September. We'll also mail you an extra preview.

Read more

Announcing the Laravel Worldwide Meetup

by Freek Van der Herten – 3 minute read

I'm happy to announce the official Laravel Worldwide Meetup. This monthly meetup will be streamed via YouTube. The first edition will be held on 14th July at 18:00 UTC.

There is a select group of people, sometimes jokingly referred to as "The Elite" that you often see speaking at Laracons and other events. Even though you will probably see some of these fine artisans on the stream, the main goal of this meetup is to introduce new speakers to the community.

Read more

Adding try/catch to Laravel collections

by Freek Van der Herten – 6 minute read

A few weeks ago, Jmac tweeted out an excellent idea. What if we could use try and catch in a collection chain?

Meanwhile, Jmac and I did a few code pairing sessions to work on a possible implementation. We've added try and catch methods to the laravel-collection-macros package.

In this blog post, I'd like to share what you can do with these methods and how they work under the hood.

Read more

A package to schedule Artisan commands at sub-minute frequencies

by Freek Van der Herten – 3 minute read

Laravel's native scheduler allows you to schedule Artisan commands to run every minute. For a project I'm working on I needed to schedule a command to run every few seconds. I found a good solution to do this using an ReactPHP powered event loop. Because this solution could be helpful for others as well, I decided to package it up.

Using the laravel-short-schedule package, you can schedule artisan commands to run every second or even lower frequencies. In this blogpost I'd like to introduce the package.

Read more