Lean Admin is a Laravel package for building custom admin panels. It's based on the TALLstack (Livewire & Alpine) and its main focus is customizability. Start by defining resources with fields and then customize anything you want. Replace CRUD actions, modify field behavior, or tweak Blade views, and much more. Lean is launching soon, and you can join the the waiting list here to get a discount.

A package to fluently generate schema.org markup

Original – by Freek Van der Herten – 2 minute read

Schema.org is a vocabulary of microdata markup that aims to make it easer for search crawlers to understand what's on a webpage. The vocabulary is very extensive: here's the official list of things that can be described with Schema.org. This article on Tutsplus explains schema.org and structured data in depth. It's kinda impossible to know the whole vocabulary by heart. That's why we created a package called spatie/schema-org that can greatly help you generate Schema.org markup.

Let's take a look at some microdata that uses the Schema.org vocubulary. This an example (taken from the Google documentation on structured data) that describes an organization.

<script type="application/ld+json">
  "@context": "http://schema.org",
  "@type": "Organization",
  "url": "http://www.your-company-site.com",
  "contactPoint": [{
    "@type": "ContactPoint",
    "telephone": "+1-401-555-1212",
    "email": "info@company.com"

Here how that markup can be generated using our package:


In our package every type in the vocabulary is it's own class, helping IDEs understand which types exist. So when you need to build up some microdata, code completion can help you immensely. Here's a demo recorded in PhpStorm.

Converting the whole vocabulary manually to PHP classes would take a lot of time. That's why my colleague Sebastian built a generator that reads the specification and converts it to almost 600 separate classes. All classes contain helpful docblocks. When the schema.org vocubulary changes in the future, all we need to do is run the generator again to bring our package up to date.

Take a look at the readme on GitHub to learn all the options of our schema-org package. Be sure to also check these framework agnostic and Laravel packages our team has made in the past.

Stay up to date with all things Laravel, PHP, and JavaScript.

Follow me on Twitter. I regularly tweet out programming tips, and what I myself have learned in ongoing projects.

Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer.

Expect quick tips & tricks, interesting tutorials, opinions and packages. Because I work with Laravel every day there is an emphasis on that framework.

Rest assured that I will only use your email address to send you the newsletter and will not use it for any other purposes.