Hey there! In Backpack v6, we introduced themes so that you can add a bit of personality to your admin panels! Changing themes is a bre...
Hey there! In Backpack v6, we introduced themes so that you can add a bit of personality to your admin panels! Changing themes is a breeze – you can do it within a couple of minutes, and we've got three fantastic new themes to choose from.
Each theme is a separate Composer package containing blade files that Backpack uses to display the interface to its admins. At this moment, we have three ready-to-use themes for you to pick from:
To switch to a different theme, first you'll need to install it like below:
composer require backpack/theme-tabler
Then you'll need to tell Backpack to use the new theme. Backpack checks the configuration in config/backpack/ui.php
. In this file, get to the section with view_namespace
and make sure you override it with this:
'view_namespace' => 'backpack.theme-tabler::',
'view_namespace_fallback' => 'backpack.theme-tabler::',
Here's the deal:
view_namespace
setting. You can even point to a local view directory if you wish.view_namespace_fallback
setting serves as a fallback mechanism. If a view isn't found in the first namespace, Backpack looks in this fallback namespace.That's it! Reload your browser and you should have the new theme working.
Each theme can also provide its own config file, so you may:
php artisan vendor:publish --tag="theme-tabler-config"
config/backpack/{theme-config}.php
to set layouts, classes, etcThrough its own config files, themes allow you to make it the best fit for your project.
Creating a new theme for your Backpack project is much easier. Follow this link for details: https://backpackforlaravel.com/docs/6.x/add-ons-tutorial-how-to-create-a-theme.
That's it for themes in Backpack v6! Choose the one that suits your project's needs, and enjoy the flexibility and power of the new theming system.
Happy theming! 🎨
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?