marekmiklusek/laravel-package-skeleton
๐๏ธ Modern Laravel package skeleton with development tools pre-configured.
A starting point for building Laravel packages, with testing, static analysis, refactoring and code style already wired up and enforced in CI.
illuminate/support only, so the skeleton does not force a framework version on consumersmax over src and testsCreate a new Laravel package from this skeleton:
composer create-project marekmiklusek/laravel-package-skeleton your-package-name
This creates a your-package-name directory with all skeleton files. Then rename
the namespace, the service provider and the package name in composer.json to
match your package.
| Command | What it does |
|---|---|
composer test |
Run every quality gate the CI pipeline runs |
composer test:unit |
Run the test suite with exactly 100% code coverage |
composer test:type-coverage |
Require 100% type coverage |
composer test:types |
Run Larastan static analysis |
composer test:lint |
Check code style and pending refactorings without writing files |
composer lint |
Apply Rector refactorings and fix code style |
Run composer test before pushing. It mirrors CI exactly.
| Path | Purpose |
|---|---|
src/ |
Your package source code |
src/PackageSkeletonServiceProvider.php |
The package service provider |
tests/TestCase.php |
Testbench base test case registering the provider |
tests/Pest.php |
Pest configuration binding Testbench to Feature only |
tests/ArchTest.php |
Architecture rules (strict types, no debug calls) |
tests/Feature/ |
Feature tests booting a real Laravel application via Testbench |
tests/Unit/ |
Unit tests running without a framework instance |
phpstan.neon |
Static analysis configuration |
rector.php |
Refactoring rules |
pint.json |
Code style configuration |
phpunit.xml |
Test runner and coverage source configuration |
.github/workflows/tests.yml |
GitHub Actions test pipeline |
.github/dependabot.yml |
Dependency update automation |
The package itself only requires illuminate/support, not the full framework.
Add further illuminate/* components to require as your package needs them,
and keep orchestra/testbench in require-dev for testing against a real
Laravel application.
See CHANGELOG.md.
The MIT License (MIT). See LICENSE.md.
How can I help you explore Laravel packages today?