laravel icon indicating copy to clipboard operation
laravel copied to clipboard

Creating model folders based on the tables prefixes

Open andrey-helldar opened this issue 6 years ago • 3 comments

Example, I have tables in one database:

gallery_marks
gallery_models
gallery_modifications
gallery_cars
news_categories
news_posts
news_other_tables
images

Now the package will create all models in the folder 'path' => app_path('Models'),

It will be fine if you can set the prefixes of the tables in the configuration to generate the models in the subfolders.

Example:

 'tables_prefixes' => [
    'gallery', 'news'
 ],

And when the command was run, the models in the folder path would be created:

Gallery/Mark::class
Gallery/Model::class
Gallery/Modification::class
Gallery/Car::class
News/Category::class
News/Post::class
News/OtherTable::class
Images::class

// And based models:
Base/Gallery/Mark::class
Base/Gallery/Model::class
Base/Gallery/Modification::class
Base/Gallery/Car::class
Base/News/Category::class
Base/News/Post::class
Base/News/OtherTable::class
Base/Images::class

It would be cool 🙂

andrey-helldar avatar Nov 02 '17 10:11 andrey-helldar

Sounds really cool!

CristianLlanos avatar Nov 02 '17 16:11 CristianLlanos

love it

Grummfy avatar Dec 28 '17 11:12 Grummfy

Let's work ?

a21ns1g4ts avatar Feb 12 '19 15:02 a21ns1g4ts