Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fields as model fillable #76

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add fields as model fillable #76

wants to merge 1 commit into from

Conversation

xwiz
Copy link

@xwiz xwiz commented Oct 17, 2015

Adds migration fields as model fillable making it easier to work with your models. No need to navigate back and forth to the db migrations folder to remember your table fields while editing your models.

@tabacitu
Copy link
Contributor

tabacitu commented Mar 8, 2020

I know this is very old @xwiz but we're just now getting to spend some time on this repo. It's sad we've taken it for granted for so long 😞

That being said, this is a great PR, and a great idea, I think.

We're working on version 2.0 and I think this will be a great addition! I have a few notes, maybe you can work on them in this PR, or if not maybe we'll be able to do it:

  • I think it would be a good idea to also include $guarded and $hidden in the model stub, even if they're commented out; some people like to use those instead of $fillable and it would make it easier for them to just comment one line and uncomment another;

To make the model generation 100% complete for 90% of use cases, we would also need to:

  • also generate relationships based on foreign keys (or on naming conventions)
  • default to generating Models inside a Models folder, but allow this to be changed inside a config file and inside the command itself

Of course, these 2 additional items are out of scope for the current PR. But let me know if this is something that excites you as much as it excites me @xwiz - I think that would reduce the time needed to build models to zero. If I had a PR that did the above too, I would merge it ASAP. But without help I'm not sure we'll be able to bring that cool feature around any time soon. I'm working on launching v2 soon #170 and I would love to have that though, let me know if you have the time and interest to collaborate on it.

Cheers!

@xwiz
Copy link
Author

xwiz commented Mar 8, 2020

@tabacitu I later extended this to something just like you said but need to do a little bit of digging to pull it out as I have stopped using it since laravel 6+

@xwiz
Copy link
Author

xwiz commented Mar 8, 2020

And of course I'd be happy to contribute if there's a clear road map or if you'd just like the two extra points as my contribution. I used it for every project back then.

@tabacitu
Copy link
Contributor

tabacitu commented Mar 8, 2020

Great to hear that @xwiz ! Yes I'm serious about launching this new improved version. I've also been using it for every project, so I feel bad for not trying to make it better 😄

Let's do this!! 🎉 🎈

First, I'm trying to close all issues & PRs. The good part of not having merged anything in 5 years is that a lot of those PRs can still be merged 😆

PS. What have you been using for this in Laravel 6+, to generate migrations?

@xwiz
Copy link
Author

xwiz commented Mar 8, 2020

OK looking great actually. I currently use infyom generators mostly but don't like the idea of using repositories since I see eloquent as a repository class already with all forms of helpers for data manipulation. I have particularly noticed however that no generator currently supports relationship generation and I'd like to see that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants