Learn to create Laravel packages - Laravel Package Training

Mark as completed

In this video I give an overview of the entire course

Links

Mark as completed

In this video, we’ll review the contents our skeleton repository and explain how it can be used to start a package.

Links

Mark as completed

In this video we are going to start building our package based on the skeleton repo. We’ll configure the namespace, write our first feature, and test it.

Somewhere in the video you see me using the cda command. This command is defined in my dotfiles. It is an alias for composer dump-autoload -o

Links

Mark as completed

We are going to take a look at how the tests can run on GitHub actions. You’ll learn how you can tests multiple PHP versions in one go using a matrix, and we’ll explore all steps of the run-tests workflow.

Finally we’re going to take a look at how GitHub displays the status of the tests in a PR.

Links

Enforcing a code style

Mark as completed

php-cs-fixer is an excellent tool to automatically fix code styling issues. In this issue you’ll learn how to run in locally and on GitHub Actions

Links

Publishing a package

Mark as completed

Now that our package contains some functionality, let’s release it, so anyone can use it.

Links

Creating a new release

Mark as completed

Let’s add some functionality to the package and create a new release from the command line.

Somewhere in this video, you’ll see me using the pf command. This is an alias defined in my dotfiles, that expands to vendor/bin/phpunit --filter

Links

Mark as completed

A PR came in to fix a method name. In this video you’ll see how I handle smallish PRs.

Links

Generating code coverage reports

Mark as completed

If you are using our package skeleton to set up your package, then you can generate code coverage reports in no time. In this video, you’ll learn how to generate those reports, and how to display them directly in PhpStorm.

In the video you see me using “xdebug off” to turn Xdebug off. My bash function actually works a little bit different. Just execute “xdebug” to toggle Xdebug on and off.

Links

Starting a Laravel package using the skeleton

Mark as completed

Our Laravel skeleton repo is an easy way to get started with a Laravel package.

Links

Exploring the Service Provider

Mark as completed

In the service provider, you can let your package hook in the various functionalities that Laravel provides.

Links

Supporting and testing multiple Laravel and PHP versions

Mark as completed

In this video you’ll learn how add support for multiple PHP and Laravel versions, and how to run the tests against all combinations of Laravel and PHP.

Links

Installing an unreleased package in a full Laravel app

Mark as completed

Even though, you have a full Laravel app available in the test suite of the package, it can be handy to, before releasing it, install the package in a real Laravel app.

Links

Using config files

Mark as completed

To allow users to customise behaviour, your package can expose a config file. In this video we’ll add a config file to our package and discuss some interesting behaviour.

Links

Adding migrations and models

Mark as completed

Packages can have migrations and models too. In this video I’ll show you how to add them to and test them in your package. As a bonus, you’ll also learn how to use factories in package tests.

Links

Using MySQL when running tests

Mark as completed

In some cases, using SQLite just isn’t enough. In this video we’ll cover how to use MySQL in tests locally and on GitHub Actions

Links

Using routes, controllers and views

Mark as completed

In this video we’ll cover how you can add routes in the package in a way that they won’t conflict with existing routes in the app. You also learn how controllers and views can be added, and how those can be tested.

Links

Let’s build a package together

Mark as completed

In this video we’re going to use everything that we’ve learned during the course to build a package from scratch.

If you want to practice your package building skills by creating a PR to the spatie/laravel-disk-monitor repo, please do so!

Links

laravel-tail

Mark as completed

Our Laravel Tail package allows you to easily tail local and remote logs. Let’s take a look under the hood

Links

laravel-collection-macros

Mark as completed

We’re going to take a look at another smallish package. Here you’ll see a nice way of separating functions to their own files.

Links

laravel-medialibrary

Mark as completed

In this video I’ll show you that you can structure your package any way you want.

Links

laravel-responsecache

Mark as completed

In this video I walk through the spatie/laravel-responsecache package. This one can speed up any Laravel app by caching response. You’ll learn how to use it, how it works under the hood, and how it is tested.

Links

laravel-multitenancy

Mark as completed

Our laravel-multitenancy package can make any Laravel app tenant aware. The philosophy of this package is that it should only provide the bare essentials to enable multitenancy.

In this video Freek will show how to use the package and how it works under the hood.

Links

laravel-short-schedule part 1: Using the package

Mark as completed

In this three part source we are going to take a look at the spatie/laravel-short-schedule. This package allows you to run Artisan commands at sub-minute intervals. In this first part you’ll learn how to use the package.

Links

laravel-short-schedule part 2: Under the hood

Mark as completed

In this second part, we are going to explore how the package works under the hood.

Links

laravel-short-schedule part 3: Testing the package

Mark as completed

Testing functionality that uses a never ending loop doesn’t have to be hard. In this video you’ll learn a pragmatic way to tests ReactPHP loops

Links

Using Psalm to analyse code

Mark as completed

Psalm is an amazing static analysis tool made by Vimeo. It can detect type errors, dead code, usages of unknown classes and much more. In this video you’ll learn how to use it within the context of a package. After you’ve seen the video, you should definitely do some research on the checks that Psalm provides and which ones are helpful for you.

If you use our PHP Package skeleton repo or Laravel package skeleton repo, than everything shown in this video is already set up.

Links

Please also add Mailcoach App/Tutorial https://mailcoach.app/