artisan-view icon indicating copy to clipboard operation
artisan-view copied to clipboard

New feature create views from Stub files

Open fjmpchato opened this issue 5 years ago • 2 comments

Hello

i want recommend add new feature for excellent Artisan-View

create views from Stub files generate

for example normally is same data only change few parameters inside of each file

i see this project https://medium.com/@devlob/laravel-crud-generators-614caddf8bea

i think can be done same way from Artisan-View for add it

$model $url $route

_form.stub
create.stub
edit.stub
index.stub
show.stub

div> @include('brands._form',[ 'url'=>route('brands.show',$model->id), 'readonly'=>true, ])

Thanks

Best Regard

fjmpchato

fjmpchato avatar Jun 19 '19 16:06 fjmpchato

Hi @fjmpchato, thanks for the suggestion! However, I feel like this is a bit too "heavy" of a feature for artisan-view. There's already an open issue that describes something similar; the idea of "presets".

So you might configure a new preset:

// config/views.php
return [
    // ...

    'presets' => [
        'crud' => [
            'extends' => 'layouts.master',
            'sections' => ['title:', 'body'],
        ],
    ],
];

... which you could then use like so: php artisan make:view posts.create --preset=crud. This is not implemented yet, as I've been rather busy with other stuff. But would that feature help you in any way? 🙂

svenluijten avatar Jun 20 '19 12:06 svenluijten

Hi @fjmpchato, thanks for the suggestion! However, I feel like this is a bit too "heavy" of a feature for artisan-view. There's already an open issue that describes something similar; the idea of "presets".

So you might configure a new preset:

// config/views.php
return [
    // ...

    'presets' => [
        'crud' => [
            'extends' => 'layouts.master',
            'sections' => ['title:', 'body'],
        ],
    ],
];

... which you could then use like so: php artisan make:view posts.create --preset=crud. This is not implemented yet, as I've been rather busy with other stuff. But would that feature help you in any way? 🙂

Sir has this feature been added yet? If yes, can we extend any layout specially the ones containing HTML content in them?

AlphaRomeoMike avatar Sep 08 '21 08:09 AlphaRomeoMike

This package has been abandoned because of the introduction of the new make:view command included in Laravel since v10.23.0. For that reason, this issue will not be worked on.

svenluijten avatar Sep 15 '23 09:09 svenluijten