# sketch:make-blueprint

The `sketch:make-blueprint` command allows you to create YAML schema files with predefined structures. This command will automatically create the necessary files and directories.

### Simple Blueprint

```bash
php artisan sketch:make-blueprint post
```

Will create `schemas/post.yaml`

### Nested Directory Blueprint

```bash
php artisan sketch:make-blueprint models/blog/post
```

Will create `schemas/models/blog/post.yaml`

### Custom Directory Blueprint

```bash
php artisan sketch:make-blueprint auth/user
```

Will create `schemas/auth/user.yaml`

### Options

| Option        | Description                      |
| ------------- | -------------------------------- |
| --soft-delete | Enable Soft Delete in the Schema |

```bash
php artisan sketch:make-blueprint models/blog/post --soft-delete
```

## Generated Blueprint Structures

The generated file will have the following structure:

```yaml
version: '1.0'
lastUpdated: '2025-01-21'
description: 'Post schema with basic configuration'
model: Post
primaryKey:
    name: id
    type: id
fields:
    - { name: name, type: string, nullable: false }
    - { name: description, type: text, nullable: true }
    - { name: email, type: string, nullable: false }
    - { name: status, type: enum, nullable: false, options: [active, inactive] }
    - { name: published_at, type: datetime, nullable: true }
    - { name: metadata, type: json, nullable: true }
timestamps: true
softDeletes: false
relationships:
    - { type: belongsTo, model: User, foreignKey: user_id, ownerKey: id }
    - { type: hasMany, model: Comment, foreignKey: post_id, localKey: id, keyType: uuid }
    - { type: hasOne, model: Profile, foreignKey: user_id, localKey: id, keyType: ulid }
```

### Configurations

The default path for schemas can be configured in `config/sketch.php`:

```php
'schemas' => [
    'path' => base_path('schemas'),
],
```
