Posts tagged with spatie

Introducing Laravel view models

stitcher.io

My colleague Brent released another awesome package called laravel-view-models. On his blog he shares some good examples and uses cases.

In essence, view models are simple classes that take some data, and transform it into something usable for the view. In this post I'll show you the basic principles of the pattern, we'll take a look at how they integrate in Laravel projects, and finally I'll show you how we use the pattern in one of Spatie's, our company, projects.

Read more [stitcher.io]

Introducing our Laravel Nova packages original

by Freek Van der Herten – 3 minute read

Introducing our Laravel Nova packages Laravel Nova is a beautiful admin panel that was first showcased at Laracon 2018 by Laravel creator Taylor Otwell. Using Nova building rich admin panels is a breeze. Nova was released today. Taylor was kind enough to give us early access to Nova shortly after…

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.

A few notes about the frontend of the renewed spatie.be original

by Willem Van Bockstal – 5 minute read

Before we moved in to our new offices in 2014, we quickly set up a temporary one-page website, initially only in Dutch. It lasted for 4 years and bursted out of its frames ever since, because… hmm … no priority, no time. A new site was like a running joke for a long time, until Laracon US 2018…

Read more

A new website for Spatie: backend highlights original

by Freek Van der Herten – 7 minute read

For the first time in 4 years we completely redesigned our company website. We launched it today. The site is a simple Laravel app with some technical niceties. True to form we also open sourced the app, you can find the code in this repo on GitHub. In this blogpost I'd like you to give you a tour…

Read more

A short introduction to laravel-event-projector original

by Freek Van der Herten – 1 minute read

The last few months I've been working on a package called laravel-event-projector. This package aims to be a simple and very pragmatic way to get started with event sourcing in Laravel. Ahead of it's release, which will happen in a few days, I've recorded a small video introduction. You can find the…

Read more

How to build a cookieless Laravel app

dieterstinglhamber.me

At Spatie We are currenlty building a new company website. One of the cool features is that it won't set a single cookie. In a new blogpost Dieter Stinglhamber explains how you can achieve this in Laravel.

Since May 25th you have been harassed by "We have updated our privacy policy" emails but also websites started to great you with "Please, let us and our 256 partners track you". In response to these abusive practices, some developers have decided to follow a better path, removing every cookie that is not needed.

Read more [dieterstinglhamber.me]

The open source department at Spatie is doing overtime original

by Freek Van der Herten – 3 minute read

Bad title because we don't do overtime at Spatie, but our team has been very busy putting out new open source stuff. In the past weeks our team has released three new packages. In this post I'd like to quickly introduce them too you. sheets First up is spatie/sheets, created by Sebastian. This…

Read more

Visual Regression Testing with Laravel

marcelpociot.de

Marcel Pociot, the mind behind BotMan, has released a cool package to create visual diff in your PHPUnit tests. Under the hood it uses our Browsershot package.

I'm not sure how you feel, but I consider myself a backend developer. Sure - I know my way around Vue.JS and really enjoy working with it, but writing CSS has never been my strong point. At one of our companies recent projects, we are working together with another development team, which is mostly taking care of frontend development. So we build controllers, repositories, services, etc. and hand it over to some basic views. They handle the rest. We introduced continuous integration to them and showed them our usual workflow, when I thought that it would be excellent to also have some kind of visual CI for frontend changes.

Read more [marcelpociot.de]

A package that makes event sourcing in Laravel a breeze ? original

by Freek Van der Herten – 11 minute read

In most applications you store the state of the application in the database. If something needs to be changed you simply update values in a table. When using event sourcing you'll take a different approach. All changes to application state are stored as a series of events. The key benefit here is…

Read more

A good issue

Sebastian De Deyne, package creator and JavaScript wizard at Spatie, gives some good tips on how to report an issue well.

Maintaining a number of open source projects comes with a number of issues. Reporting a good issue will result in a more engaged approach from project maintainers. Don't forget: there's a human behind every project.

https://sebastiandedeyne.com/posts/2018/a-good-issue

Read more

Improving the performance of spatie/laravel-permission

Barry van Veen recently fixed an interesting performance issue at our permissions package.

Recently I was investigating the performance of an application we have built at SWIS. To my surprise, one of the most excellent costly methods was part of the spatie/laravel-permission package. After reading some more it was clearly a performance issue that could be improved upon. Since the solution was already clearly outlined it was quite easy to code it and submit a pull request.

https://barryvanveen.nl/blog/46-improving-the-performance-of-spatie-laravel-permission

Read more

Automatically close stale issues and pull requests original

by Freek Van der Herten – 5 minute read

At Spatie we have over 180 public repositories. Some of our packages have become quite popular. We're very grateful that many of our users open up issues and PRs to ask questions, notify us of problems and try to solve those problems, ... Most of these issues and PRs are handled by our team. But…

Read more

Learn to create an RSS Feed from scratch in Laravel

Over at Laravel News Paul Redmond, author of Docker for PHP developers, wrote a good post on how to use our RSS package to add a feed to a Laravel app.

Creating an RSS feed in Laravel isn’t the most challenging task, but using a package and a few tips can help you create an RSS feed relatively quick.

We are going to use the spatie/laravel-feed package to walk through going from a brand new Laravel 5.6 project to serving RSS feeds.

https://laravel-news.com/learn-to-create-an-rss-feeds-from-scratch-in-laravel

Read more

Uploading avatar Images with Spatie’s medialibrary

Over at Laravel News Povilas Korop wrote a nice tutorial on how to use our medialibrary (we released a new major version a couple of days ago).

By default, the Laravel registration form contains only the name, email, and password, but often it’s useful to allow the user to upload a photo or an avatar. In this tutorial we will show you an easy way to add it, using Spatie’s Media Library package.

https://laravel-news.com/uploading-avatar-images

It's a good tutorial but there's a few things not mentioned. At the end of the post you'll see this line of code:

Auth::user()->getMedia('avatars')->first()->getUrl('thumb');

That can be written a bit shorter as :

Auth::user()->getFirstMediaUrl('avatars', 'thumb');

The new v7 of the medialibrary has a new feature called "single file collections", which is just perfect for this example. Take a look at the docs: https://docs.spatie.be/laravel-medialibrary/v7/working-with-media-collections/defining-media-collections#single-file-collections

Read more

laravel-medialibrary v7 has been released ? original

by Freek Van der Herten – 14 minute read

laravel-medialibrary is a powerful 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. At Spatie we use this package in nearly every project. The last few months our team has…

Read more

Server side rendering JavaScript from PHP

My colleague Seb did some amazing work with the creation of two packages that make it easy to get started with server side rendering in PHP. In a new post on his blog he'll tell you all about it.

Server side rendering is a hot topic when it comes to client side applications. Unfortunately, it's not an easy thing to do, especially if you're not building things in a Node.js environment.

I published two libraries to enable server side rendering JavaScript from PHP: spatie/server-side-rendering and spatie/laravel-server-side-rendering for Laravel apps.

Let's review some server side rendering concepts, benefits and tradeoffs, and build a server renderer in PHP from first principles.

https://sebastiandedeyne.com/posts/2018/server-side-rendering-javascript-from-php

Read more

Today we hit 10 million PHP package downloads original

by Freek Van der Herten – 2 minute read

For the past few years Spatie, the company where I work, has released many Laravel and PHP packages. Those packages are primarily built to be used in our own projects. We do not operate in a void. We have a community around us. They use our work. They help to make our packages better by submitting…

Read more

Responsive images done right

Our team is currently prepping a new version of our medialibrary. One of the highlights is support for responsive images. On his blog my colleague Brent explains what it entails and why it is important.

I want to share some thoughts on responsive images. I'll write about a certain mindset which many projects could benefit from: small- and mid-sized web projects that don't need a full blown CDN setup, but would enjoy the performance gain of responsive images.

https://www.stitcher.io/blog/responsive-images-done-right

Read more

Using Content Security Policy headers in a Laravel app original

by Freek Van der Herten – 5 minute read

By default all scripts on a webpage are allowed to send and fetch data from and to any site they want. If you think about it, that's kinda scary. Imagine that one of your JavaScript dependencies would send all keystrokes, including passwords, to a third party website. That would be pretty bad. In…

Read more