Package accompanying the LaravelPackage.com documentation.
This package is meant to provide a reference when you're following along with the documentation on LaravelPackage.com. Along the way, we'll build a demo package (called "BlogPackage") by introducing the functionalities (as listed below) one-by-one. When something doesn't work as expected in your own package, you might use this repository to quickly find out if the bug is in your package or in the documentation (by running this package's test suite).
The demo package features the following components:
git clone [email protected]:Jhnbrn90/BlogPackage.git
composer install
composer test
Now you're free to use this demo package to your advantage. You can also include the demo package in a Laravel project if you wish, check the section below.
You can easily use this packge in a local Laravel project, after cloning:
// composer.json
{
"repositories": [
{
"type": "path",
"url": "../../blogpackage" // the relative path to your package
}
]
}
composer require johndoe/blogpackage
php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="config"
php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="migrations"
php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="views"
php artisan vendor:publish --provider="JohnDoe\BlogPackage\BlogPackageServiceProvider" --tag="assets"
This package includes a Unit and Feature test suite covering all mentioned components. You can easily run all tests for this package using composer test
, or a specific test using composer test-f test-name-here
.