Okipa / laravel-model-json-storage

Storing your models in a json file rather than in database (single or few lines recording) can be a good option. This package saves you to create a table for a ridiculous amount of lines, improves the data recovery performances, and allows you to store and access to your models from a json files as you would do it in database.
MIT License
25 stars 16 forks source link

Eloquent relations #1

Open nam-co opened 6 years ago

nam-co commented 6 years ago

Hi, thanks for the package, I was wondering if its possible to use relations like BelongTo from other models with this package?

Thank you for your time

Okipa commented 6 years ago

Hello @nam-co, yes, I think it would be possible but it represents something quite complex to setup and to test. It would demand time and digging into the Eloquent ORM to override the right methods.

What is your use case, needing this to be developed ?

nam-co commented 6 years ago

Hi @Okipa thanks for the answer, for example #user->Country->currency, when a countries json file probable doesn't change that much, it makes sense to have a json file

Okipa commented 6 years ago

@nam-co
I will try to implement this when i'll have some time but right now, I am working on an other repository (https://github.com/Okipa/laravel-bootstrap-components). I would consider merge requests is someone is up to make the relationships working with this package (https://laravel.com/docs/5.6/eloquent-relationships).

nam-co commented 6 years ago

The B4 components look good, I once tried something similar but didn’t put much effort https://github.com/maksuco/b4c/blob/master/README.md , I like yours better, would you able to put css classes and js data- to the echo render?

Okipa commented 6 years ago

You can indeed set class and html attributes to each component with default values in config. For discussion / features requests about other packages, please open issues in it to keep this issue clean and understandable for eventual contributors ;)