plugin icon indicating copy to clipboard operation
plugin copied to clipboard

[Feature Request]: Support for Laravel Actions

Open eclipse313 opened this issue 2 years ago • 6 comments

Feature Description

Hello,

I've been using the plugin for a few months and it has made my work in PhpStorm with Laravel much easier.

However, since I started using Laravel Actions I notice that there is no support here yet.

Is there a plan to add support for the Actions from this package, as there is for other third party packages such as Nova. Due to the structure of the Actions traits (asJob, asCommand) I think it shouldn't be that challenging to integrate this.

Thanks a lot Thomas

eclipse313 avatar Jul 10 '22 15:07 eclipse313

Hello. What kind of support do you mean?

adelf avatar Jul 10 '22 19:07 adelf

Hey @adelf, thanks for your reply! I'd be happy to elaborate.

This is how Laravel Actions are described in their documentation:

Instead of creating controllers, jobs, listeners, etc., you can create a PHP class that does a specific task and run that class as an arbitrary class.

Actions can be used as an object, controller, job, listener, command or faker. Therefore, it would be very helpful if the Idea Helper recognizes as what type my action is created and then at the entsrpechenden places where Autocomplete would otherwise just suggest me a method in a controller or a job, then suggests the appropriate action.

Example: in web.php when assigning routes, Autocomplete shows all controllers with their methods: if all actions with the "asController" trait would be shown here, that would be very helpful.

Furthermore, yes, the plugin has a generator for new files: again, it would be great if you could create a new action and select the traits to use and so the corresponding methods would be created directly in the action.

Finally, it would also be helpful within an action to store the available methods that are inherited by autocomplete to see what options I have.

The documentation gives some very good examples and explanations: if you have understood the usage and functionality of the actions, this will also result in useful applications for the plugin.

Maybe we can compile the useful functions here, in addition to my explanations.

Best regards Thomas

eclipse313 avatar Jul 10 '22 23:07 eclipse313

Do you need any more information or can you be helped in any other way to move this feature request forward?

Thanks! Thomas

eclipse313 avatar Jul 21 '22 17:07 eclipse313

Hi 👋,

Also I'm interested on autocomplete for Laravel action rules. for reference

devmoath avatar Aug 17 '22 19:08 devmoath

Hello. What kind of support do you mean?

On Sun, Jul 10, 2022, 19:08 Thomas @.***> wrote:

Feature Description

Hello,

I've been using the plugin for a few months and it has made my work in PhpStorm with Laravel much easier.

However, since I started using Laravel Actions https://laravelactions.com/ I notice that there is no support here yet.

Is there a plan to add support for the Actions from this package, as there is for other third party packages such as Nova. Due to the structure of the Actions traits (asJob, asCommand) I think it shouldn't be that challenging to integrate this.

Thanks a lot Thomas

— Reply to this email directly, view it on GitHub https://github.com/laravel-idea/plugin/issues/581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVQCWSRO7NMYZAKBZS4E5LVTLROTANCNFSM53FEZMDA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

adelf avatar Oct 11 '22 07:10 adelf

Basically, my point is:

  • Autocompletion e.g. in the Routes, that here the actions are indicated.
  • When I create a new action, that I am asked if it should be created as Command, Job, ... and then the corresponding methods are already in the file.
  • if actions are used as job, that e.g. dispatch() also suggests the actions

Finally it would also be great if I could right click (or shortcut) in the action to "Add new functions to the action" so that e.g. with a function "Add Validation" the corresponding methods getValidator() etc. would be added automatically.

@devmoath: Can you add your suggestions to the list?

eclipse313 avatar Oct 17 '22 15:10 eclipse313

Is there an update on the current status?

eclipse313 avatar Sep 12 '23 12:09 eclipse313

if actions are used as job, that e.g. dispatch() also suggests the actions

You mean this?

image

adelf avatar Sep 14 '23 20:09 adelf

The dispatch() topic is probably the least important and related to the corresponding facade.

I am mainly concerned with the wizard when I create new actions (https://share.cleanshot.com/BNVVYmPK).

An action can be used

  • As object
  • As controller
  • As job
  • As listener
  • As command

Here it would be nice if I could select this accordingly in the dialogue and the corresponding use AsJob statements could be built in directly in the newly created action.

If I now create an action as a job, for example, I have the following functions to choose from that I can use in my action to control it: https://laravelactions.com/2.x/as-controller.html#routes

It would be nice if I now had the possibility in the source code of this action that these methods are now suggested to me directly or I could add them via a wizard - as required.

Do you understand what I mean? Otherwise, take a few screenshots...

eclipse313 avatar Sep 15 '23 15:09 eclipse313

So, you prefer using AsJob and other traits instead of one AsAction?

adelf avatar Sep 15 '23 15:09 adelf

image

If you have any hints on what should be added to the action class code by each checkbox, excluding the last one, I'll be happy) I don't use this package, so I could make wrong decisions here...

adelf avatar Sep 19 '23 17:09 adelf

https://twitter.com/laravel_idea/status/1706280815171076316

adelf avatar Sep 25 '23 12:09 adelf

Looks stunning, and like a real improvement!I will next week times a detailed feedback 😊Am 25.09.2023 um 15:52 schrieb Adel @.***>: https://twitter.com/laravel_idea/status/1706280815171076316

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

eclipse313 avatar Sep 25 '23 13:09 eclipse313

Implemented in 7.4

adelf avatar Sep 28 '23 14:09 adelf