Introduction
Quick Start
Bootstrap a fresh Laravel project with OSDD in one command.
The fastest way to get started with OSDD is to use osdd:start on a fresh Laravel project.
osdd:start is a destructive command designed for fresh projects only. It deletes the app/, database/, and config/ directories. Never run it on an existing project with code you want to keep.Step by Step
1. Create a fresh Laravel project
Terminal
composer create-project laravel/laravel my-app
cd my-app
2. Install Laravel OSDD
Terminal
composer require xefi/laravel-osdd
3. Run the bootstrap command
Terminal
php artisan osdd:start
The command will:
- Create
functional/userslayer with User model, factory, seeder, migration, andUsersServiceProvider - Create
technical/osddlayer withOsddServiceProviderand config - Delete the legacy
app/,database/, andconfig/directories - Clean up legacy PSR-4 entries (
App\,Database\Factories\,Database\Seeders\) from rootcomposer.json - Rewrite
bootstrap/providers.phpto bootTechnical\Osdd\Providers\OsddServiceProvider - Register both layers as Composer path repositories in root
composer.json - Optionally run
composer update
4. Your new structure
After the command completes, your project looks like this:
functional/
users/
composer.json
src/
Models/User.php
Providers/UsersServiceProvider.php
database/
factories/UserFactory.php
migrations/xxxx_create_users_table.php
seeders/UsersSeeder.php
technical/
osdd/
composer.json
src/
Providers/OsddServiceProvider.php
config/
bootstrap/
providers.php ← boots Technical\Osdd\Providers\OsddServiceProvider
composer.json ← has path repos for both layers
Add Your First Layer
With the architecture in place, add a new domain layer:
Terminal
php artisan osdd:layer
You'll be prompted for:
- Which path bucket (
functionalortechnical) - The layer name (e.g.
orders) - Which generators to scaffold (migration, model, factory, etc.)
Then optionally run composer update functional/orders to register it.
See Creating Layers for full details on the
osdd:layer command and all available generator options.