invibe-sk / backpack-on-steroids

0 stars 1 forks source link

Love the name! What does this do? #1

Closed tabacitu closed 2 years ago

tabacitu commented 2 years ago

I laughed when I saw this 😀 What does it do more exactly? Can't quickly tell from the readme or the traits themselves.

Cheers!

PS. Consider providing a description of the features and/or a screenshot if you want more eyeballs 😉

invibe-sk commented 2 years ago

Hi, thank you for your interest ! First of all, thank you for backpack. We love it and we are using it in almost all of our projects. We have tried all of the admin builders out there and we think that backpack is the best of them. Hope we don't breach some rules by extending it a bit - we have bought the unlimited licence (without the premium devtools, which was not yet available at the time when we made the purchase)

As of right now, package doesn't do much. Specifics:

  1. It publishes (overwrites) vendor/backpack/base/inc/scripts.blade.php, where it adds one script include for filemanager and one for compiled JS with VueJS (which is also published into public folder) along with one component, which then serves as field for image / files upload (similar to this one which was made for laravel nova: https://github.com/ebess/advanced-nova-media-library). Traits only slightly alter the logic behind creating and updating models. More specifically - they add one step which is responsible for assigning selected files / images to models. The logic behind that is done via https://github.com/spatie/laravel-medialibrary.
  2. It adds different filemanager and alters tinymce field to use it. Here are some screenshots:
Screenshot 2021-11-04 at 18 10 50 Screenshot 2021-11-04 at 17 51 19

Unfortunately, both screenshots are from project where only slovak language is available as it is the first project which this package is used in, so we have no other project to provide screenshots from. But it should be obvious. Here is how you would then use the files field type after installing the package and doing the steps in readme:

Screenshot 2021-11-04 at 18 18 00

It has several options for cropping images, multiple / single file upload, file size constraint for some frontend validation right after you select the file, aspect ratio, labels for buttons (for customizing the button labels, for example: Upload more images/files/documents), and so on. Hope you get the idea. The name of the field has to match one of the collections registered in registerMediaCollections method which medialibrary package from spatie is using.

As of right now, we think that our package is not really 100% ready or complete and it currently only serves our internal purposes. It doesn't have any tests, etc. So we probably won't update the readme for a while to avoid some confusion. In the future, we plan on adding a page builder field so we can then replace the wysiwyg editor for pages content, and we have some other ideas to make it really worthy of the name of the package. We will also probably split the package into several smaller packages in the future. Let's say for example you want only the gallery field and not the other stuff. Right now, it cannot be separately added to project, you also have to have the replaced filemanager. So there is a lot of work left to be done and we will probably add some statement to the current readme that this package is not really production ready right now.

Again, thank you for your interest, looking forward to backpack v5, which is now hinted in pricing tables 😀 Keep up the good work. If you have any further questions, feel free to ask them.

tabacitu commented 2 years ago

That looks awesome! We're planning on adding a "media" field type to Backpack too (see https://github.com/Laravel-Backpack/ideas/issues/28 ) which would make working with spatie/media-library easier - pretty much what you have done, apparently. Great work!

Extending Backpack is perfectly ok, of course. We appreciate it.

Your plans look great - I do think this can be optimized a bit too, mainly to encapsulate all the logic inside the field type itself (the CSS and JS). Perhaps with an additional trait on the Model - that way it'd be easier to use. The fact that it creates its own operation triggers my spidey-sense for some reason - it can probably be done in a less intrusive way.

But even as it is (I understand it's a kind of closed-beta) it looks really nice. Plus... you know... as long as it works for your project, it's perfect 😀

Let me know if you need feedback on this when you make changes, if you ever intend to make this "public". Cheers!