Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/mtolhuys/laravel-schematics

A Laravel package making a diagram of your models, relations and the ability to build them with it
https://github.com/mtolhuys/laravel-schematics

diagrams drag drop explanation laravel schematics

Last synced: 21 days ago
JSON representation

A Laravel package making a diagram of your models, relations and the ability to build them with it

Lists

README

        



Laravel Schematics

[![Latest Version on Packagist](https://img.shields.io/packagist/v/mtolhuys/laravel-schematics.svg?style=flat-square)](https://packagist.org/packages/mtolhuys/laravel-schematics)
[![Build Status](https://img.shields.io/travis/mtolhuys/laravel-schematics/master.svg?style=flat-square)](https://travis-ci.org/mtolhuys/laravel-schematics)
[![Quality Score](https://img.shields.io/scrutinizer/g/mtolhuys/laravel-schematics.svg?style=flat-square)](https://scrutinizer-ci.com/g/mtolhuys/laravel-schematics)
[![Total Downloads](https://img.shields.io/packagist/dt/mtolhuys/laravel-schematics.svg?style=flat-square)](https://packagist.org/packages/mtolhuys/laravel-schematics)

This package allows you to make multiple **diagrams** of your Eloquent **models** and their **relations**.
It will help building them providing drag and drop relations, forms to **create** and **edit** your models and many options like
adding **resource controllers**, **form requests** and running **migrations** by the click of a button or (configurable) automatically.
It also will give you insights in the migrations you ran and the ones specified in your migrations folder.

![Schematics Example](resources/images/readme/intro.png)

Its aim is to help you (and your team) get more grip on the models from a code perspective,
the status of your migrations and build / edit them faster.

---

## Installation

You can install the package via composer:

```bash
composer require mtolhuys/laravel-schematics --dev
```

Run `php artisan schematics:install` which will do the route caching, create vendor assets in your public folder and
setup the configuration file.

Or...

```php
php artisan vendor:publish --provider="Mtolhuys\LaravelSchematics\LaravelSchematicsServiceProvider"
```

and visit `{your-app}/schematics`

---

## Usage

#### Starting out / Searching
If you already have a lot of models I recommend you use the search bar to narrow down the diagrams into
specific sections f.e:

![Schematics Example](resources/images/readme/search-example.png)

These searches are saved across your diagrams.

#### Relations
When you drag and drop the arrow to another model you'll get a form to specify the relation you want to build f.e:

Clicking on them will show something like:

![Relation Example](resources/images/readme/relation-example.png)

#### Building / Editing Models

To specify the types of your columns I've chosen the form request rule syntax.
To see what's available you can click the little help icon below the fields in the model form:

![Fields Explanation](resources/images/readme/fields-explanation.png)

The package is flexible enough to differentiate between renaming and changing column types.
It will create migrations according the need to change or create a table and setup your `$fillables`.
I do **strongly** suggest you check the migrations before running them if the stakes are high.

You don't have to worry about existing migrations though, the package will only look for migrations it created itself
by checking the value of the `@tag` in the comment it adds. It looks like this:

```php
/**
* Laravel Schematics
*
* WARNING: removing @tag value will disable automated removal
*
* @package Laravel-schematics
* @author Maarten Tolhuijs
* @url https://github.com/mtolhuys/laravel-schematics
* @tag laravel-schematics-foobar-model
*/
```

#### Changing Diagram Style

There are 4 diagram styles. Bezier, Straight, Flowchart and State Machine:

#### Importing / Exporting Diagrams

To save and / or share the diagrams you created you can use the export and import settings feature:

---

### Testing

You can run the tests with:

```bash
composer test
```

Or, optionally, with coverage information:

```bash
composer test-coverage
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Credits

This package is possible because of the effort and time of these people! ✨






Maarten Tolhuijs



Creator️





Deisi Tolhuijs



Design







Dennis Mwea



Contributor







Robbin Schepers



Contributor







Bram van Rijswijk



Support







Lucas Snel



Contributor



## Contributing

Since I'm getting some questions about this I want these things to be perfectly clear:

- This is a **safe** haven for contributions, every (positive) contributon matters!
- You are free (and encouraged) to use **anything** of this package for your own ideas.
- You can **always** ask for help or email me directly for any questions.

Please see [CONTRIBUTING](CONTRIBUTING.md) for further details.

### Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.