GrafiteInc / CMS

Decoupled CMS for any Laravel app, gain control of: pages, blogs, galleries, events, images, custom modules and more.
https://cms.grafite.ca
MIT License
495 stars 104 forks source link

How to delete file attribute from model? #169

Closed yapsr closed 5 years ago

yapsr commented 6 years ago

I have uploaded a hero_image to the blog model successfully. How do I delete this attribute in the CMS? It seems this is not supported yet.

My config/cms.php:

    'forms' => [
        'blog' => [
            ....
            'content' => [
                ....
                'hero_image' => [
                    'type' => 'file',
                    'alt_name' => 'Hero Image',
                ],
            ],
mlantz commented 6 years ago

Just comment out that field

//'hero_image' => [
//    'type' => 'file',
//    'alt_name' => 'Hero Image',
//],

We use the FormMaker kit for the whole CMS so it makes it easy to add and remove components from the base modules.

yapsr commented 6 years ago

@mlantz I'm sorry I wasn't clear.

I mean how to delete a file attribute value from a model in het CMS? As a user I can only upload a file. Not delete it. I would need some sort of delete button.

mlantz commented 6 years ago

lol wow, I'm a moron, totally missed that, give me a day or so to add that

yapsr commented 5 years ago

@mlantz When would this feature be available in a package update?

yapsr commented 5 years ago

It would also be nice if the 'delete'-feature would be available to all fields of type 'file', based on the cms/config.php file.

mlantz commented 5 years ago

Hey @yapsr I forgot to issue a release with those fixes, I'll release that today.

I like the idea of having the ability to delete any file input types, add that to my list, not sure when I'll be able to add that, but as always PRs are welcome