laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

How to remove doc blocks from models once created?

Open jcc5018 opened this issue 2 years ago • 2 comments

Versions:

  • ide-helper Version: #.#.#
  • Laravel Version: #.#.#
  • Lumen Version: #.#.#
  • PHP Version: #.#.#

Question:

I ran php artisan ide-helper:model as :generate was generating an error code saying it cannot regenerate a method i have in my helpers file.

I didn't really understand what it would do, but now it has very long doc blocks on all my 140+ models and I would like to remove them in favor of the separate file. Is there a quick way of doing this without manually deleting a bunch of code? I saw another question that I thought would do this "resetting" with -R but that just added all the code again from the ones I just got through removing.

Also, any idea what to do with my helper method? I may not have this set up right, though it does work. I have the following HELPER file that I call in a few controllers to find the options for a given enum_type.

function getOptions ($type) { return $options = DB::table('enum_options') ->join('enum_types', 'enum_types.id', '=', 'enum_options.enum_type_id') ->select('enum_options.*') ->where('enum_types.name', $type) ->get(); }

jcc5018 avatar Feb 20 '22 05:02 jcc5018

If you had not versioned your models prior running the ide-helper or have no other means of back up, then you probably need to undo the changes manually (or come up with a script; or your IDE allows multi-line regex, etc.)

mfn avatar Feb 21 '22 20:02 mfn

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this issue is still present on the latest version of this library on supported Laravel versions, please let us know by replying to this issue so we can investigate further. Thank you for your contribution! Apologies for any delayed response on our side.

stale[bot] avatar Jun 12 '22 19:06 stale[bot]

Closing due to lack of feedback

mfn avatar Feb 20 '23 15:02 mfn