laravel-idea / plugin

Laravel Idea plugin for PhpStorm
https://laravel-idea.com/
164 stars 7 forks source link

"New Eloquent Model" UI discussion #741

Closed adelf closed 1 month ago

adelf commented 1 year ago

Planned features:

krisalcordo commented 1 month ago

Is there a way to add a relationship after the model is created or do we have to manually do this for now?

spitfire64 commented 1 month ago

Maybe a checkbox for creating a simple Livewire component? EDIT: Amazing stuff, thanks!

bmckay959 commented 1 month ago

Great plugin!

I deal with a bunch of 3rd party data where the table structure is essentially already done. A lot of these have a bunch of columns(50+ sometimes).

  • It would be nice when 'tabbing' to create a new field, if the scroll area would auto scroll down to see the new input.

Hello, I just wanted to bring this back in the discussion. I would really love this feature. I deal with a large number of columns in tables. The first 15-20 columns are great and allow me to add faster than ever before, but once the fields come out of view and I tab to create a new field, it would be really nice if the list of fields would scroll to the active form field.

7 fields fit in the UI...once I try to create the 8th, you can see the field is only half visible and the 9th field is completely hidden and I have to move to my mouse to scroll down.

Screenshot 2024-07-19 at 11 17 40 AM Screenshot 2024-07-19 at 11 18 41 AM
adelf commented 1 month ago

Hi, @bmckay959. Thank you for mentioning this again) and sorry for this being not fixed all this time. Fixed. I'll try to release an update soon.

adelf commented 1 month ago

I'm closing this issue, since this UI looks finished for me now, so, please create new issues.

For all: the main idea of this UI to be as lightweight as possible. I need field and their types to create corresponding code: migrations, factories, etc. I don't need default values and indices for that. You can add it in the migration, that's why the migration file opens first after creating a model.

@kjaonline, I'm going to add a special actions, like "Add Field to existing model", or "Add Relation to existing model". They will try to add fields and relations to model, and also some related classes: factory, resource, etc.

@caendesilva I made field names depending on table name before, so if you have $table = "github_repositories", it will suggest github_repository_id field name. I don't know which Pest test should be created. Usually tests are testing some Use Cases. Like publishing the post. Making tests for CRUD operations... maybe only some base template. If you have any ideas - please share.

@spitfire64, what kind of Livewire component should it be? It's hard to guess, but if you have any ideas - please, welcome.

@altayevrim I've already fixed the policy issue. About boolean field defaults... where should they be? Migrations? Or model $attributes field?

krisalcordo commented 1 month ago

@adelf would it help for me to create a new issue for this?

@kjaonline, I'm going to add a special actions, like "Add Field to existing model", or "Add Relation to existing model". They will try to add fields and relations to model, and also some related classes: factory, resource, etc.

adelf commented 1 month ago

@kjaonline it's not necessary. It's already in our internal task tracker.

spitfire64 commented 1 month ago

@adelf Just by creating a component named Index.php in a subfolder (given the model name) instead of an ordinary Controller would have been nice. Inside this file, why not define all columns as properties, then maybe the mount() and render() methods empty. The render might return a view in a corresponding subolder named index.blade.php.

Another suggestion: Your template engine could also generate some lines that can be copied: The routes. (either traditional CRUD-rotes or a Livewire-route, depending on the checkbox named "livewire")