PHPackages                             daycode/sketch - 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. daycode/sketch

ActiveLibrary[Framework](/categories/framework)

daycode/sketch
==============

Sketch is a powerful, easy-to-use package for rapidly generating YAML-Based CRUD functionality in Laravel applications.

v2.0.0(1y ago)02MITPHPPHP ^8.3.0CI failing

Since Jan 21Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dayCod/sketch)[ Packagist](https://packagist.org/packages/daycode/sketch)[ Fund](https://www.paypal.com/paypalme/wirandraalaya)[ GitHub Sponsors](https://github.com/dayCod)[ RSS](/packages/daycode-sketch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (9)Versions (5)Used By (0)

 [![Sketch Logo](https://github.com/dayCod/sketch/raw/master/art/sketch-logo.png)](https://github.com/dayCod/sketch/blob/master/art/sketch-logo.png)

 [![Latest Stable Version](https://camo.githubusercontent.com/0368161163d44353bbbfbba8b4dc197c8b8d99bc6bd361988b3379c3148453e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646179636f64652f736b65746368)](https://packagist.org/packages/daycode/sketch) [![Total Downloads](https://camo.githubusercontent.com/9dffdc259e47e720b0de9d05f10f8dc0f0524a0c267e95f5d6bbcb9eb805ddb1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646179636f64652f736b65746368)](https://packagist.org/packages/daycode/sketch) [![License](https://camo.githubusercontent.com/4cc310752f1bbd9c9e53eb7ff95617addc91b92db83a54a2d5fe6f7be1cf534d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f646179636f64652f736b65746368)](https://packagist.org/packages/daycode/sketch)

Blueprint-Based Structure Generator
-----------------------------------

[](#blueprint-based-structure-generator)

Sketch is a powerful Laravel package that transforms your application development workflow. Instead of starting with migrations or models, Sketch allows you to define your entire application structure using simple YAML blueprints. This schema-first approach ensures consistency and accelerates development across your Laravel applications.

Features
--------

[](#features)

- 📝 **Blueprint-Based Generation**

    - Define your entire application structure in YAML
    - Generate models, migrations, and services from a single source
    - Maintain consistency across your application components
- ⚡ **Rapid Development**

    - Eliminate repetitive boilerplate code
    - Generate complete application components in seconds
    - Focus on business logic instead of scaffolding
- 🧩 **Built-in Relationships**

    - Support for all Laravel relationships
    - Automatic foreign key generation
    - Proper relationship method generation
- 🏗️ **Service Repository Pattern**

    - Generate service and repository layers
    - Follow SOLID principles automatically
    - Maintain clean architecture effortlessly

Quick Installation
------------------

[](#quick-installation)

1. Install the package via Composer:

```
composer require daycode/sketch
```

2. Publish the configuration:

```
php artisan vendor:publish --provider="Daycode\Sketch\SketchServiceProvider"
```

Quick Usage
-----------

[](#quick-usage)

1. Create a YAML blueprint:

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

2. Define your schema in the generated YAML file:

```
model: Post
primaryKey:
    name: id
    type: integer
fields:
    - { name: title, type: string, nullable: false }
    - { name: content, type: text, nullable: true }
    - { name: status, type: enum, nullable: true, options: ['draft', 'published'] }
timestamps: true
softDeletes: true
relationships:
    - { type: belongsTo, model: User, foreignKey: user_id }
```

3. Execute Specific Files

```
php artisan sketch:generate --file=schemas/models/blog/post.yaml
```

Configuration
-------------

[](#configuration)

After publishing the configuration file, you can modify these settings in `config/sketch.php`:

```
