mercredi 1 novembre 2017

Can I change the style/format of Laravel's Artisan-generated files? [duplicate]

This question already has an answer here:

If I run php artisan make:controller UserController --resource, Laravel (5.5) will generate a controller for me with some pre-populated functions (index, show, store, etc.). This obviously extremely handy, however it does generate these functions with a specific style:

function index()
{
    //
}

Is it possible to change it, so that instead it generates functions like this?

function index() {
    //
}

This would be to get the generated code to conform to our coding style guide.

This is admittedly an incredibly minor thing, and it's certainly not that much of an issue to just correct the brackets manually, but it would be great if there were a way to get Laravel to do this automatically. It would be even better if such a functionality could be built as a package that we could just require on other Laravel projects, though I'm not entirely sure how one would do that - so I'll just start with 'is this even possible?'



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2z4bbin
via IFTTT

Aucun commentaire:

Enregistrer un commentaire