Laravel Packages

Package Pages

So you want to develop a laravel package locally? Well, this is the tutorial for you. This tutorial will show you how to get started with the boilerplate provided by BeyondCode and how to set it up so that you can develop locally.

Prerequisites

Make sure you have PHP installed locally. Be familiar with the basics of laravel. Terms like Facades and service providers should not be new to you.

Package boilerplate

Start by heading to https://laravelpackageboilerplate.com/ and filling in the information required. It should allow you to download a zip file. Extract this zip file to a directory where you can find it. You want your directory structure to look like this:

packageName
packageName/source <-- extracted zip

Create a normal laravel project in the packageName directory with the command

curl -s "https://laravel.build/testing" | bash

You should now have the following structure:

packageName
packageName/source <-- extracted zip
packageName/testing <-- your laravel project

Go into the testing directory and add the following to your composer.json:

"repositories": {
        "VENDOR_NAME/PACKAGE_NAME": {
            "type": "path",
            "url": "../source",
            "options": {
                "symlink": true
            }
        }
    }

Copy from your source directory the name property in the composer.json to the VENDOR_NAME/PACKAGE_NAME in the above code.