[SPATIE] Laravel Package Training – Learn to create Laravel packages

Learn how to create
a Laravel package

Become the next package maestro


Having produced over 200 packages with more than 75 million downloads in total, the Spatie team knows what they’re talking about.

Dive in the mind of the people that brought you quality packages like laravel-permission, laravel-backup, browsershot, laravel-medialibrary and learn how to program, test, and maintain your very own packages.

What you’ll learn:

  • Building a framework agnostic PHP package

    Basic structure, testing, GitHub actions, Packagist, …
  • Building a Laravel package

    Build a real Laravel package from scratch
  • Source dive Spatie packages

    Get a tour of real life examples

Course overview

4 hours of content

For all functionality that is added to a package, you’ll learn how to automatically test it, both locally and via GitHub Actions. This way you can build a beautiful and maintainable package that your co-workers, clients, and the community can rely on.

All videos are available in our online course environment, where you can track your progress.


Building a framework agnostic PHP package

  • Using the Spatie PHP package skeleton to get started building an agnostic package
  • Adding a first class to the package
  • Testing a package using PHPUnit
  • Automatically fix code style issues locally
  • Running the tests on GitHub actions
  • Fixing code style issues using GitHub Actions
  • Using Psalm to analyse and detect problems with your code
  • Generating code coverage reports using Xdebug
  • Supporting multiple PHP versions
  • Using semantic versioning
  • Keeping a changelog
  • Registering the package on Packagist
  • Publishing a new release on GitHub
  • Taking care of community contributions


Building a Laravel package

  • Using the Spatie Laravel package skeleton to get started building a Laravel specific package
  • Adding a config file to the package
  • Adding an artisan command
  • Adding models and migrations to the package and how to automatically test them
  • Adding routes, controllers and views in a way that they don’t conflict with application routes
  • Running the tests of the Laravel package on GitHub Actions
  • Using MySQL in the package tests and on GitHub Actions
  • Testing artisan commands using PHPUnit and Orchestra Testbench
  • Testing routes, controllers and views
  • Supporting multiple PHP and Laravel versions of your package
  • Developing a Laravel package inside a full Laravel application
  • A whopping 90 minute live coding video where we bring together the knowledge of the entire course to build a real life package from scratch. Watch Freek code and explain his thought process.

Why create packages?

By moving common functionalities to packages, the codebase of your apps can become smaller and more maintainable.

Packages can have their own testsuite. When a bug is discovered, you can easily distribute the fix in your apps by merely running composer update.

There are commercial benefits as well. By open sourcing packages, you as a developer, and your company become much more visible in the community, which can lead to interesting opportunities coming your way.


Meet your instructor

Chances are you already have!

Freek Van der Herten is a developer and partner at Spatie, a Belgium-based company specializing in creating Laravel apps.

The company has an open-source first mentality. Freek and his team have released over 200 packages, that are loved by the community, and which have been downloaded for over 75 million times.

Freek also has a passion for spreading his knowledge. In addition to regularly speaking at local user groups and some of the world’s best conferences, he also publishes posts on PHP, Laravel, and programming in general at his well-respected blog.


Size: 1.59GB


Course: https://spatie.be/products/laravel-package-training

Friendly Websites

OneHack.Us | Tutorials For Free, Guides, Articles & Community Forum.

Leave a Comment