mtolhuys / laravel-schematics

A Laravel package making a diagram of your models, relations and the ability to build them with it
MIT License
1.49k stars 133 forks source link

Support for non-standard model directory path for DDD Laravel Sites #28

Closed ejntaylor closed 4 years ago

ejntaylor commented 4 years ago

This might be too edge case, but I recently started using a Laravel boilerplate which places the Models inside a non-standard location (src/App/) due to using Domain Driven Design pattern..

Any ideas on supporting a site structure like this? Thanks

mtolhuys commented 4 years ago

Hi @raisonon , support for this is coming very soon actually. Top of the list right now.

It will be set through the config where you can point to multiple paths through an array.

mtolhuys commented 4 years ago

@raisonon you could try it out with 0.10.0.

config now:

'model' => [
    'namespace' => 'App\\',
    'paths' => [
        app_path(), \\ Add any path you want the mapper to scan
    ],
],
cord commented 4 years ago

Reading from a custom path works, however when I try to add a field the POST to /schematics/models/edit fails with Exception "message": "Cannot replace non-existing $fillable", when hitting the save button.

Drag & drop to sort the new field does not work (can't drop in the list of existing fields)