Download the PHP package eleven59/backpack-settings-extended without Composer
On this page you can find all versions of the php package eleven59/backpack-settings-extended. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download eleven59/backpack-settings-extended
More information about eleven59/backpack-settings-extended
Files in eleven59/backpack-settings-extended
Package backpack-settings-extended
Short Description Extends Backpack settings package to allow for categorization of settings, file/image uploads, custom entity names, and custom sort order
License MIT
Homepage https://github.com/eleven59/backpack-settings-extended
Informations about the package backpack-settings-extended
Backpack Settings Extended
Extension for backpack/settings
This package extends the Backpack for Laravel backpack/settings
package:
- easily create multiple backend pages for settings so you can categorize them for your users
- custom sort order for settings list pages
- customize entity names (instead of "setting"/"settings")
- default options for field types (e.g. custom ckeditor build)
- add widgets to list or update operations
- translatable settings
Installation
Dependencies
This package requires
Installation
Via Composer
You will now find the config file at config/eleven59/backpack-settings-extended.php
Usage
Multiple settings pages
This packages adds a type
column to the settings table. Using this column, you can create multiple backend settings pages to categorize settings. You can configure the routes in the config
file as follows:
If you've added an entry to the database that has "type-column-value" in the type
column, that settings entry will now automatically show up on the following pages if you have the above array in your config file:
Default options for field types
You can use the config/eleven59/backpack-settings-extended.php
file to add custom default definitions for field types, so you don't have to enter complex stuff in the database, that sometimes does not even work (e.g. for ckeditor fields like in the example below).
Note: the defaults are overwritten if the main key (i.e., 'crop' or 'withFiles' below) exists in the field definition in the database. The defaults are only used if the entire key is missing from the field definition in the database.
Widgets
You can define widgets for both the list and update operations (since these are the only two available anyway). This will allow you to load custom scripts and css for example, which may help with some of the more convoluted custom default column defaults.
Custom sort order
This package adds a position
column to the settings table. By default, the list pages are ordered by this column in ascending order. You can change this behavior in the config/eleven59/backpack-settings-extended.php
file:
Custom entity string names
This package allows you to change the default entity names of "setting" for singular and "settings" for plural. By default, the backpack/settings strings are used. You can change their values in the config/eleven59/backpack-settings-extended.php
file:
Translatable
If you want to use translatable settings, you can do so by enabling the custom Settings model included for that:
Once you enable this, it "just works" and will automatically enable all languages you have enabled in the config/backpack/crud.php
settings file.
Unfortunately, the way spatie/translatable
works, this setting can't be enabled on a per-entity basis (since it requires setting a static property on the model itself). So it's either all settings are translatable or none of them are.
Change log
Breaking changes will be listed here. For other changes see commit log.
V2.1
The default model has been changed to the model that does not include the HasTranslations
trait. This is better for those upgrading from backpack/settings after having already implemented it, because spatie/translatable
changes the way the data is stored in and read from the database. Enabling by default would mean data loss, since all settings fields in the admin would be empty (because no translations could be found).
However, since v2.0 of this package, the default model did include translations. If you're updating from v2.0, please make sure to use the translatable model, as described above under the translatable heading.
V2.0
- Now only works with backpack/crud:^6.0 and backpack/settings:^3.1
- Accordingly, now requires PHP 8.1+ and backpack/pro is needed for pro fields
- Added requirement for spatie/laravel-translatable:^6.0 for the translations
- Removed requirement for eleven59/backpack-images-traits. This is already possible out of the box with Backpack 6.0 since you can use the WithFiles directive now.
Credits
License
This project was released under the MIT license, so you can install it on top of any Backpack & Laravel project. Please see the license file for more information.
However, please note that you do need Backpack installed, so you need to also abide by its YUMMY License. That means in production you'll need a Backpack license code. You can get a free one for non-commercial use (or a paid one for commercial use) on backpackforlaravel.com.
All versions of backpack-settings-extended with dependencies
backpack/settings Version ^3.0
spatie/laravel-translatable Version ^6.0