PHPackages                             jptagorda/laravel-package-starterkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. jptagorda/laravel-package-starterkit

ActiveLibrary[Framework](/categories/framework)

jptagorda/laravel-package-starterkit
====================================

A Laravel package starterkit with action-based architecture, contracts, and strict conventions

v1.0.0(3mo ago)01MITPHPPHP ^8.4

Since Jan 27Pushed 3mo agoCompare

[ Source](https://github.com/jptagorda/laravel-package-starterkit)[ Packagist](https://packagist.org/packages/jptagorda/laravel-package-starterkit)[ RSS](/packages/jptagorda-laravel-package-starterkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Laravel Package Starterkit
==========================

[](#laravel-package-starterkit)

A production-ready Laravel package template with action-based architecture, strict conventions, and comprehensive tooling.

Overview
--------

[](#overview)

This starterkit provides a solid foundation for building Laravel packages that follow best practices:

- **Action-based architecture** for predictable state mutations
- **Contract-driven design** for testability and flexibility
- **Value objects** for type-safe, immutable data
- **Pest + Orchestra Testbench** for robust testing
- **Pre-configured tooling** (Pint, Prettier, PHPUnit)

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 12+
- Composer 2.0+

Installation
------------

[](#installation)

Install the starterkit in your Laravel application:

```
composer require jptagorda/laravel-package-starterkit --dev
```

Quick Start
-----------

[](#quick-start)

### Create a New Package

[](#create-a-new-package)

Use the Artisan command to scaffold a new package:

```
php artisan make:package vendor/package-name
```

**Example:**

```
php artisan make:package acme/billing
```

This creates a fully configured package at `packages/acme/billing/` with:

- Service provider with auto-discovery
- Exception hierarchy
- Test infrastructure (Pest + Orchestra Testbench)
- Configuration file
- Documentation stubs
- Code style configs (Pint, Prettier)

### Command Options

[](#command-options)

```
# Create a new package
php artisan make:package acme/my-package

# Overwrite existing package
php artisan make:package acme/my-package --force
```

### After Scaffolding

[](#after-scaffolding)

```
cd packages/acme/my-package
composer install
composer test
```

### Add to Root composer.json

[](#add-to-root-composerjson)

Add the package as a path repository:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/acme/my-package"
        }
    ]
}
```

Then require it:

```
composer require acme/my-package
```

Generated Structure
-------------------

[](#generated-structure)

```
packages/acme/my-package/
├── src/
│   ├── Actions/              # State mutation classes
│   ├── Contracts/            # Interface definitions
│   ├── Exceptions/           # Package-specific exceptions
│   │   ├── PackageException.php
│   │   ├── ValidationException.php
│   │   └── ConfigurationException.php
│   ├── ValueObjects/         # Immutable data containers
│   └── MyPackageServiceProvider.php
├── config/
│   └── my-package.php
├── tests/
│   ├── Feature/
│   │   └── ServiceProviderTest.php
│   ├── Unit/
│   ├── Pest.php
│   └── TestCase.php
├── .docs/
│   ├── index.md
│   ├── installation.md
│   ├── configuration.md
│   └── usage.md
├── composer.json
├── README.md
├── CHANGELOG.md
├── phpunit.xml.dist
├── pint.json
└── .prettierrc

```

Architecture Guidelines
-----------------------

[](#architecture-guidelines)

### Actions

[](#actions)

All state mutations flow through Action classes:

```
