Download the PHP package elbadawy/laravel-backpack-crud-extended without Composer
On this page you can find all versions of the php package elbadawy/laravel-backpack-crud-extended. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-backpack-crud-extended
Laravel Backpack CRUD Extended
This package extends Backpack/CRUD. See all features added bellow.
To do this without any modification on your controller or others package, this package:
- is able to override all Backpack/CRUD views;
- extends CrudPanel class.
Table of Contents
- Installation
- Publish views
- Configuration
- Usage & Features
- Permissions
- CRUD Boxes
- Fields Drivers
- Language / i18n
- Upload Field : UploadableFile Trait
- Upload Field : file_upload_crud validation rule
- Image Field : UploadableImage Trait
- CRUD : custom routes
- Testing
- Lint
- Contributing
- Licence
Installation
In your terminal:
Then, if you are on Laravel 5.4 (no need for Laravel 5.5 and higher), register the service provider to your config/app.php
file:
Publish views
If you have already published backpack-crud views, this package will not work.
You have to remove views into resources/views/vendor/backpack/crud/
, or to override them with:
Configuration
Some options that you can override are available.
Usage & Features
Permissions
Description
- Permissions can be applied automatically to CRUD Controllers : deny access if user hasn't the permission linked to the route =>
apply_permissions
option - Permissions can be automatically created for all Crud Controllers used in you application (4 permissions will be created : list, update, create, delete) =>
create_permissions_while_browsing
option - Permissions can be automatically given to the logged user (useful in local environment) =>
give_permissions_to_current_user_while_browsing
option
Requirements
- This feature require : Laravel-Backpack/PermissionManager
-
You have to publish config file :
- Set to true each options that you want activate
Usage
Your CrudController must extend \Novius\Backpack\CRUD\Http\Controllers\CrudController
CRUD Boxes
You can now split your create/edit inputs into multiple boxes.
In order to use this feature, you just need to specify the box name for each of your fields.
You can also specify some options to each box:
If you forget to specify a tab name for a field, Backpack will place it in the last box.
You can specify manually a default box in the crud file. If your field doesn't have the box attribute, this field will be displayed in this default box.
Fields Drivers
Fields type can now be a classname:
This allows you to propose new field types in external packages. Your Field class must implement Field Contract.
Language / i18n
Set a custom dictionary for a specific crud:
This dictionary will then be used in the CRUD views.
You can use it in your own views like this:
Upload Field : UploadableFile
Trait
If you use Upload CRUD Field, you can implement this Trait on your Model to automatically upload / delete file(s) on server.
Example:
Upload Field : file_upload_crud
validation rule
A validation rule exists to easily validate CRUD request with "upload" field.
Example of usage in your requests files:
Image Field : UploadableImage
Trait
If you use the Image CRUD Field, you can implement this trait on your model to automatically manage saving and deleting the image on the server.
Example:
If you want to perform some custom actions on your image after saving or deleting it :
MediaLibrary
If you want to store the images in the MediaLibrary provided by Spatie, use the trait SpatieMediaLibrary\UploadableImage
instead of UploadableImage
.
For example with the MediaLibrary you can easily manage conversions (crop, resize, ...).
Translations
Both traits UploadableImage
and SpatieMediaLibrary\UploadableImage
are compatible with the translation package provided by Spatie.
In the case of translatable images with SpatieMediaLibrary\UploadableImage
, the name of the collection where the image is stored is composed of the name of the attribute and the locale, separated by a dash (eg. image-en
, image-fr
, ...).
CRUD : custom routes
You can set a custom value to some routes.
- Index route : used with "back to all" button or breadcrumb's link. Available with
$crud->indexRoute()
. - Reorder route : used with "Reorder button". Available with
$crud->reorderRoute()
.
Example of usage in your CrudController :
Testing
Run the tests with:
Lint
Run php-cs with:
Contributing
Contributions are welcome! Leave an issue on Github, or create a Pull Request.
Licence
This package is under GNU Affero General Public License v3 or (at your option) any later version.
However, this package requires Backpack\CRUD, which is under YUMMY license: if you use it in a commercial project, you have to buy a backpack license.