Skip to content

Support for custom models file #139

@brendt

Description

@brendt

I'm not sure why, but with certain versions of this plugins things stop working. Especially when it comes to model properties not being found.

I would like to suggest a feature where you can instruct psalm to use the existing models files, instead of generating a new one on the fly.

I had a look at \Psalm\LaravelPlugin\Plugin::ingestModelStubs and thing the feature wouldn't be that difficult to implement. In my mind it would look something like this:

  • Read an optional config value that contains a path to the models file, if this value is set it should be used instead of a dynamically generated one
  • Copy this file over to the plugin's cache directory
  • Set self::$model_classes to contain the correct value — still need to figure that one out, but that shouldn't be any rocket science.

I want to PR this myself but I'll need some pointers on what the right approach is here. Would love your input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions