This will guide you through upgrading from Backpack 3.3 to 3.4. For upgrading from 3.2 to 3.3 check out the previous upgrade guide.
As you can see, we've struggled very hard to make this version as backwards-compatible as possible. As such, the upgrade steps are small, and few projects will be negatively affected, unless they've overwritten default functionality.
composer.json
and run composer update
)composer require backpack/base:"^0.9.0"
composer require backpack/crud:"^3.4.0"
This brings A LOT of new features and makes sure all components are up-to-date.
[OPTIONAL, but recommended]
config/app.php
file, if you have any Backpack service providers or aliases (any for any Backpack package), you can remove them; they're no longer needed, since L5.5 loads them automatically; routes/backpack/custom.php
. That's where CRUD::resource()
routes are generated automatically, when you generate a new CRUD. To future-proof your application, you can publish that file using php artisan vendor:publish --provider="Backpack\Base\BaseServiceProvider" --tag=custom_routes
, then manually move your existing admin routes there (from your routes/web.php
).admin
middleware with the backpack_middleware()
helper; this will pull in the admin middleware name, since you can now change that in the config file;Backpack\Base\app\Http\Middleware\Admin
anywhere, make sure to extend the new class name: Backpack\Base\app\Http\Middleware\CheckIfAdmin
;Auth::user()
and Auth::check()
calls with backpack_auth()->user()
and backpack_auth()->check()
etc, everywhere in your admin panel's custom controllers, models, views;[MANDATORY]
resources/views/vendor/backpack/base
:
7.1. Delete any base
blade files that you have not personally customized; namely layout.blade.php
; in most cases you should be left with only inc/sidebar.blade.php
;
7.2. Create a inc//sidebar_content.blade.php
file and copy all of your sidebar items and subitems there (<li><a href=""></a></li>
; here's an example file);
7.3. Delete your resources/views/vendor/backpack/base/inc/sidebar.blade.php
file; this is no longer used to store sidebar items, the one above is; and we have the added benefit of being able to do so from the command line;public/vendor/backpack
and public/vendor/adminlte
folders; we will republish them shortly;php artisan backpack:base:install
; this might take a few minutes, but it will republish all assets needed;browse
field type, run composer require barryvdh/laravel-elfinder
to install it, since it's no longer a mandatory requirement;syncPivot()
method, please note that it's no longer used inside the Create trait and in the Update trait; It hasn't been deprecated yet, but we do plan to remove it in the future since createRelations()
is a complete replacement for it, is more legible and supports 1-n relationships too;search()
method take a look at the changes and apply them to your own;admin
middleware with the configurable name, in you config/elfinder.php
, like so;<td>
s with <span>
s; example here;browse_multiple
, date_picker
, date_range
, datetime_picker
, select
, select2
, select2_from_ajax
, select2_from_ajax_multiple
, select2_from_array
, select2_multiple
, date
), you should update their JS and CSS assets like we have done here, to make sure it can still reach those assets; list.blade.php
file, you're in a pickle; the changes are massive; best thing to do would be to delete your file, copy the new one, and make the modifications you need again;addColumn()
statement before all the others, in your ExampleCrudController::setup()
;php artisan view:clear
to make sure your views are using the new assets.Then you'll love our premium add-ons - productivity tools and tons of new features.