Posts tagged with spatie

A package to assign statuses to Eloquent models original

by Freek Van der Herten – 2 minute read

Imagine you want to have an Eloquent model hold a status. It's easily solved by just adding a status field to that model and be done with it. But in case you need a history of status changes or need to store some extra info on why a status changed, only adding a single field won't cut it. To handle…

Read more

Customizing the Spatie dashboard

At Spatie, we have created a dashboard powered by Laravel, Pusher and Vue that displays a lot of information useful for our company. We opensourced the dashboard a while ago.

In a new post on his company blog Chris Sherry explains how they customized our dashboard.

We use Laravel because its a well-known framework among backend developers, meaning there’s a bigger community (including lots of open source libraries), great documentation and a tonne of experience of using the framework.

Vue.js is our first choice because it lets our frontend developers build components for a project without being to be locked into building the whole project on the framework, meaning we can use the right tools for the right job.

The fact that the Spatie dashboard used these meant that all the developers at CUBE would be able to build their own components for it, which was one of my key objectives.

https://3sidedcube.com/blog/2018/02/building-dashboard-laravel-vuejs/

It's really great to see that people customize and use our stuff!

Read more

Join 9,000+ developers

Every month, 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.

Handling CORS in a Laravel application original

by Freek Van der Herten – 5 minute read

Recently we released laravel-cors. This package can add the necessary CORS headers of your Laravel app. In this post I'd like to give a quick explanation of what CORS is and how you can use the package. What is CORS Imagine that all JavaScript code for domain X running in a browser would be able to…

Read more

The story behind our open source efforts original

by Freek Van der Herten – 15 minute read

This post was first published on 24daysindecember.net Chances are that you've never heard of my company Spatie. We specialise in creating Laravel applications for our clients. Our team is rather small: we consist of only 6 developers and one manager. On first glance we are just a web agency like…

Read more

spatie/async will be released soon

My colleague Brent is currently creating a new package called spatie/async. This one will let you easily do some asynchronous parallel processing in PHP. In a new post on his blog Brent explains why we are creating the package and compares it to a few other solutions out there.

If you're into parallel PHP, you probably heard of Amp and ReactPHP. Our package aims not to compete with those two, as it only solves one tiny aspect of parallelism in PHP. We did however use both the packages to run some benchmarks against. Let's take a look at the results.

https://www.stitcher.io/blog/asynchronous-php

Read more

Some interesting numbers about the PHP GitHub repos in 2017

Marcel Pociot, author of BotMan, used GitHub and Google BigQuery to look up some interesting numbers about the PHP repos in 2017.

It's this time of the year again - the end of the year is coming up fast, so why not step back and take a look at what we, as a PHP community, have achieved this year?

For these statistics, I used the free GitHub Archive data in combination with Google BigQuery, which lets you process 1TB of data per month free of charge.

So let's take a look at some numbers.

http://marcelpociot.de/blog/2017-12-21-a-php-year-in-review

My team is mentioned in the article too. Pretty proud of this!

As you can see, Spatie - a company doing a ton of open source projects - is on this list 16 times. Well done ???? !

Read more

An async map function original

by Freek Van der Herten – 3 minute read

Laravel has an excellent Collection class that has many useful operations. The class is also macroable. This means that you can add function to it at runtime by calling macro on it and passing a name and a closure. In our projects we tend to code up the same macro's over and over again. That's why…

Read more

Laravel-medialibrary v7 preview: media collections original

by Freek Van der Herten – 5 minute read

laravel-medialibrary is a package that can help handle media in a Laravel application. It can organise your files across multiple filesystems, generate thumbnails, optimize images and much much more. Like mentioned before on this blog my team and I are currently creating a new major version, v7,…

Read more

Laravel-medialibrary v7 preview: multi file downloads original

by Freek Van der Herten – 4 minute read

laravel-medialibrary is a powerhouse package that can help handle media in a Laravel application. It can organise your files across multiple filesystems, generate thumbnails, optimize images and much much more. My team and I are hard at work creating a new major version, v7, that adds a lot of…

Read more

A package to use optimised UUIDs in Laravel

Using regular UUIDs stored as a text-based primary key is very slow. Our newly released package spatie/laravel-binary-uuid aims to solve that by binary storing a slightly tweaked version of the UUID. My colleague Brent wrote a blogpost describing how it works behind the scenes. He also included some interesting benchmarks.

The binary encoding of UUIDs solved most of the issue. There's one extra step to take though, which allows MySQL to even better index this field. By switching some of the bits in the UUID, more specifically time related data, we're able to save them in a more ordered way. And it seems that MySQL is especially fond of ordered data when creating indices.

https://www.stitcher.io/blog/optimised-uuids-in-mysql

Read more

On migrating my blog from WordPress to a Laravel application original

by Freek Van der Herten – 12 minute read

Regular visitors will have noticed that last week this blog got a new coat of paint. This new layout isn't just a new WordPress theme. Things have changed on the backend as well. Previously my blog was powered by WordPress. I've migrated it to a custom built Laravel app. That app is open sourced.…

Read more

A beautiful webapp to fetch dns records original

by Freek Van der Herten – 3 minute read

Recently my company Spatie launched https://dnsrecords.io, a beautiful site to quickly lookup dns records. True to form, we also opensourced it, here is the sourcecode on GitHub. If you want to do some dns lookups in your own app, you'll be happy to know that we extracted the dns lookup…

Read more

Backup multiple sites and frameworks with Laravel Backup

Tim MacDonald, a freelance software developer living in Australia, wrote down how he used our backup package to backup his Laravel and Wordpress sites.

I’m not going to run you through the standard setup or all the great features of the package here, you should definitely get your feet wet and give it a go. You’ll be up and running with backups in no time at all. From here on I’ll assume you’ve had some experience with the package, as to not over explain every step along the way…I do tend to rant off topic otherwise ?

I wanted to have a standardised backup system in place for all my sites. This system would have to include Laravel and WordPress installs - so I tinkered with Spatie’s Laravel Backup package and have managed to get a single install of Laravel to backup all my sites independently, including my WordPress sites ?

https://timacdonald.me/backup-multiple-sites-frameworks-laravel-backup/

Read more

A Laravel package to log HTTP requests original

by Freek Van der Herten – 1 minute read

Most of the sites we build for our clients contain some sort of contact form. For those client such forms are potentially critical to their business. Imagine for instance a real estate firm that generates leads with such forms. In most cases we will store the submitted values in the db and mail them…

Read more

The official Vue.js style guide

The maintainers of Vue.js have recently published their official style guide.

This is the official style guide for Vue-specific code. If you use Vue in a project, it’s a great reference to avoid errors, bikeshedding, and anti-patterns. However, we don’t believe that any style guide is ideal for all teams or projects, so mindful deviations are encouraged based on past experience, the surrounding tech stack, and personal values.

For the most part, we also avoid suggestions about JavaScript or HTML in general. We don’t mind whether you use semicolons or trailing commas. We don’t mind whether your HTML uses single-quotes or double-quotes for attribute values. Some exceptions will exist however, where we’ve found that a particular pattern is helpful in the context of Vue.

https://vuejs.org/v2/style-guide/

Want to see some more style guides? At Spatie we have a guidelines site containing styleguides for Laravel and JavaScript.

This site contains a set of guidelines we use to bring our projects to a good end. We decided to document our workflow because consistency is one of the most valuable traits of maintainable software.

The contents of this site exist for ourselves—more importantly, our future selves—and for giving future collegues a reference to our way of doing things and their quirks. The guidelines cover workflow, code style, and other little things we consider worth documenting.

https://guidelines.spatie.be

Read more

Handling Stripe webhooks in a Laravel application original

by Freek Van der Herten – 5 minute read

In the project I'm currently working on I had to integrate Stripe webhooks. Stripe has great documentation on how to handle webhooks, but it still took a fair amount of time to get the integration just right. My solution for handling webhooks is pretty generic and reusable by others. I decided to…

Read more

New features in our packages original

by Freek Van der Herten – 3 minute read

Every time our team releases a package I have the habit of writing an introductory blogpost. But after the initial release most pages gain more features through PRs by the community and ourselves. Mostly these new feature go unnoticed. That's why I plan on regularly writings posts on noteworthy…

Read more

A trait to dynamically add methods to a class original

by Freek Van der Herten – 4 minute read

We recently released our newest package called macroable. It contains a trait that, when applied to class, can dynamically add methods to that class. This trait is basically a stand alone version of the macroable trait in Laravel. In this post I'd like to show you how you can use it, how it works…

Read more