DuckThom / laravel-packager by DuckThom

Create a Laravel package template with ease
15
1
2
Package Data
Maintainer Username: DuckThom
Maintainer Contact: thomas.wiringa@gmail.com (Thomas Wiringa)
Package Create Date: 2017-03-14
Package Last Update: 2017-03-15
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2025-02-09 15:13:54
Package Statistics
Total Downloads: 15
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0
    composer require luna/laravel-packager "~1.0"

Then, add the service provider to config/app.php:

    "providers" => [
        // snip
        Luna\Packager\ServiceProvider::class,
    ];

If you want to use the package in the current project without adding it to, for example, packagist just yet, ie. for development, add the following line to your main project's composer.json:

{
    "autoload": {
        "classmap": [
            "database",
            "packages"   #  Add this line to your main projects composer.json
        ],
        "psr-4": {
            "App\\": "app/",
            "Tests\\": "tests/"
        }
    }
}

After adding that line, run composer dump, and add the package's service provider to config/app.php.

For example, you made a package which has the following structure: <project_root>/packages/Foo/Bar/BarServiceProvider.php.

When you add the line to the composer.json in the project root, you can use that service provider with it's usual namespace: Foo\Bar\BarServiceProvider::class.

    php artisan make:package <Vendor> <Package> [--base-dir=packages]

Be default, the package files are created in <project_root>/packages/Vendor/Package.

By specifying --base-dir in the make:package command, you can change where the files are placed.