Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing keys into CreateResourceRequest.php #3

Open
ala747 opened this issue Aug 11, 2018 · 1 comment
Open

Changing keys into CreateResourceRequest.php #3

ala747 opened this issue Aug 11, 2018 · 1 comment

Comments

@ala747
Copy link

ala747 commented Aug 11, 2018

Hi! Thanks for this great tool, it's being very useful!

I need to change the naming convention ('model' and 'model.property') for keys into the generated code, ie. current:

    public function rules()
    {
        return [
            '**role**' => 'array|required',
            '**role**.name' => 'required|string'
        ];
    }
    public function attributes()
    {
        return [
            '**role**.name' => 'the role\'s name'
        ];
    }

ie. desired:

    public function rules()
    {
        return [
            '**name**' => 'required|string'
        ];
    }
    public function attributes()
    {
        return [
            '**name**' => 'the role\'s name'
        ];
    }

in order to be able to POST/PATCH the properties without the model wrapper but I can't find where are those lines generated. Could you please point me in the right direction?

Thanks!

@Versoo
Copy link
Owner

Versoo commented Aug 22, 2018

@ala747
Hi, Sorry for so long time of my response. If I good understand your question, you want to change templates of generated classes:

In file versoo.larapi-fast.php at line 53 you need to setup directory with your custom templates:

/*
* Directory for custom stubs files.
* If NULL commands use default stubs files.
*/
'stubs_directory' => null,

Default you can found in directory of package: vendor/versoo/larapi-fast/src/Command/stubs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants