matthewbdaly / laravel-package-boilerplate
Starting boilerplate for Laravel packages. Override the content in here when creating your own package
Requires (Dev)
- infection/infection: ^0.26.19
- matthewbdaly/artisan-standalone: 0.0.*
- mockery/mockery: ^1.5
- orchestra/testbench: ^8.0
- orchestra/testbench-browser-kit: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpcompatibility/php-compatibility: ^9.3
- psalm/plugin-laravel: ^2.8
- slevomat/coding-standard: ^8.3
- squizlabs/php_codesniffer: ^3.7
- vimeo/psalm: ^5.8
README
Boilerplate for Laravel packages. Use it as a starting point for your own Laravel packages.
Includes PHPUnit and PHPCodeSniffer configuration, as well as a known good Travis CI configuration and a couple of base test cases. Uses orchestra/testbench
as the basis of the provided base test.
Also includes my Artisan Standalone package as a development dependency. As a result, you should be able to run Artisan commands as follows:
vendor/bin/artisan make:model Example
How do I use it?
Step 1
composer create-project matthewbdaly/laravel-package-boilerplate <YOUR_NEW_PACKAGE_DIRECTORY>
This will generate a starting boilerplate for your app.
Step 2
You'll want to update your composer.json
with your required namespace and other details - you can do this by running
vendor/bin/artisan app:name InsertYourProjectNameHere
Test cases
The package includes three test cases:
TestCase
- Effectively the normal Laravel test case. Use it the same way you would your normal Laravel test caseSimpleTestCase
- Extends the default PHPUnit test case, so it doesn't set up a Laravel application, making it quicker and well-suited to properly isolated unit testsBrowserKitTestCase
- Sets up BrowserKit