Skip to content

Incorrect use statement generated in controller if models_path is blank #60

@tkerns

Description

@tkerns

Environment:

  • Laravel-Code-Generator Version: 2.2
  • Laravel Version: 6.6

Description:

I am trying to create a project with the models in the app root (as opposed to a Models directory), as Laravel 5.6 seems to do by default.
I am setting the models path to an empty string in the config file
'models_path' => '',

When you generate a controller , and model_path is blank in config, there is an extra \ between App and model name in controller use statement.
use App\\ModelName

Steps/Commands To Reproduce:

generate a resource file
create:resources ModelName

look in created controller, and the use statement for the model has extra backslash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions