https://github.com/duckthom/laravel-packager
Create Laravel packages with ease
https://github.com/duckthom/laravel-packager
laravel package
Last synced: 30 days ago
JSON representation
Create Laravel packages with ease
- Host: GitHub
- URL: https://github.com/duckthom/laravel-packager
- Owner: DuckThom
- License: mit
- Created: 2017-03-14T19:40:20.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-15T08:41:57.000Z (about 9 years ago)
- Last Synced: 2024-12-29T16:45:23.730Z (over 1 year ago)
- Topics: laravel, package
- Language: PHP
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Laravel Packager
# Prerequisites
This package should run on PHP 5.5+ and Laravel 5.1+.
# Setup
First, add this package to your `composer.json`:
```
composer require luna/laravel-packager "~1.0"
```
Then, add the service provider to `config/app.php`:
```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: `/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`.
# Usage
```
php artisan make:package [--base-dir=packages]
```
Be default, the package files are created in `/packages/Vendor/Package`.
By specifying `--base-dir` in the `make:package` command, you can change where the files are placed.