Since our last progress report, our team has put the final touches on quite a few difficult features. These have been multi-month effor...
Since our last progress report, our team has put the final touches on quite a few difficult features. These have been multi-month efforts, and I think you'll be very happy with the results - we know we are 😀
Despite being used more, we've received a lot fewer bug reports... which means Backpack v5 is becoming super-stable. We're now at only 20 open issues in our main repo... and most of them aren't even bug reports 🎉
Big thanks to our team members Pedro and Jorge for getting this number down, every week 🙏
We do have some exciting stuff we've launched in the past month. So much so, that we've decided to bump the minor version - Backpack is now at 5.4.x 🎉 And here they are:
Previously, our ListOperation got slower, the more records you had in the database. For most CRUDs this wasn't really noticeable... when you got to millions maybe you noticed, IF you were using a lot of columns too.
But Backpack is also used for super-complex apps - things like CRMs, ERPs etc. And those really can have CRUDs with 100M+ entries AND 20+ columns, at the same time. It's a real use case, that we've neglected. Until now, you had to manually optimize your CRUDs, do a few tricks to make them work ok. But now... now it will be faster, out of the box... and it can be BLAZING FAST, if you just hide the table count. I'll let the numbers speak for themselves:
Yes you read that right. In some complex cases, this can bring a pageload from 22s down to 0.06s 🤯 Big big thanks to Pedro Martins (@pxpm) for working on this one. It wasn't easy at all to do this, especially in a non-breaking manner 👏👏👏
You don't have to do anything other than composer update
to get a HUGE performance improvement. And if you want to further reduce the pageload... it's a one-liner. Read the docs for more info.
morphTo
relationThis is another feature that Pedro has been working on... for months! And it's finally ready for prime-time. It was previously super-difficult to add fields for morphTo
relations. But now... now it's dead-simple.
Say you have multiple Eloquent models, and all of them are commentable
. That means you have a comments
table in the database, which has commentable_id
(eg. 1, 2, 3) and commentable_type
(eg. article, video, post, image, comment). All your comments are stored in one big database table. If you had a Comments CRUD, it was pretty difficult to have a "Create Form" for Comment... because... how do you choose which entity it belongs to... and that entity's ID... bleah. But now? With something as simple as this:
CRUD::field('commentable')
->addMorphOption('App\Models\Video')
->addMorphOption('App\Models\Post', 'Posts', [
[
'data_source' => backpack_url('comment/fetch/post'),
'minimum_input_length' => 2,
'placeholder' => 'select an amazing post',
'method' => 'POST',
'attribute' => 'title',
]
]);
You can get a two-part field that allows you to pick either Video or Post, and then a particular Video or Post. And notice the Post is an AJAX field in this example 🤯 It looks and works spectacularly, and it's quite extensible too. You can check out the docs for more info and try it out in our demo but also... look at this simple beauty:
This has NOT been easy at all, so big thanks to Pedro again!
Well ok... it's not technically a new field. Previously, we had an enum
field which made it easy to use MySQL ENUMs. Now... Pedro has added support for PHP ENUMs, inside that same field. So... it's basically two fields in one... because they both happen to have the same name.
Check out the docs, it's as simple to use as you'd expect!
While writing articles alongside Karan Datwani, we've noticed some files weren't as easy to generate as we wanted. So we've asked Karan to help us out with a few new commands, and he did. Now, you can do:
php artisan backpack:button {button_name}
php artisan backpack:column {column_name}
php artisan backpack:field {field_name}
php artisan backpack:filter {filter_name}
php artisan backpack:widget {widget_name}
But you can also do this, to create one field starting from another field:
php artisan backpack:field custom_select2 --from="select2"
These commands
Big thanks to Karan & Antonio for getting these finished, polished and launched.
That's it from us for September and October. We're working on a few more cool stuff - so please subscribe to our weekly/monthly digest if you haven't already, follow us on Twitter or like us on Facebook.
Thanks for using Backpack. We love doing this for you. Cheers!
Subscribe to our "Article Digest". We'll send you a list of the new articles, every week, month or quarter - your choice.
What do you think about this?
Wondering what our community has been up to?