PHPackages                             elbadawy/laravel-backpack-crud-extended - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. elbadawy/laravel-backpack-crud-extended

ActiveLibrary[Admin Panels](/categories/admin)

elbadawy/laravel-backpack-crud-extended
=======================================

This package extends Laravel Backpack\\CRUD

0.3.3(6y ago)0134AGPL-3.0PHPPHP &gt;=7.1

Since Aug 21Pushed 6y agoCompare

[ Source](https://github.com/elbadawy/laravel-backpack-crud-extended)[ Packagist](https://packagist.org/packages/elbadawy/laravel-backpack-crud-extended)[ RSS](/packages/elbadawy-laravel-backpack-crud-extended/feed)WikiDiscussions 3.6-support Synced yesterday

READMEChangelog (1)Dependencies (5)Versions (25)Used By (0)

Laravel Backpack CRUD Extended
==============================

[](#laravel-backpack-crud-extended)

[![Travis](https://camo.githubusercontent.com/60ff640e451934a0b8181d16e994c22fd4b12e90ebb774877b97803326136628/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6e6f766975732f6c61726176656c2d6261636b7061636b2d637275642d657874656e6465642e7376673f6d61784167653d31383030267374796c653d666c61742d737175617265)](https://travis-ci.org/novius/laravel-backpack-crud-extended)[![Packagist Release](https://camo.githubusercontent.com/7debe9aba4bdd5730dde51fd70978732c49f7b4971d5fef0bed3ddedf9b6963a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e6f766975732f6c61726176656c2d6261636b7061636b2d637275642d657874656e6465642e7376673f6d61784167653d31383030267374796c653d666c61742d737175617265)](https://packagist.org/packages/novius/laravel-backpack-crud-extended)[![Licence](https://camo.githubusercontent.com/169ce32baaa54e27cfbaf383bd0cfde2b4f24acf64ab3c24a1872e30c4dfa5d7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e6f766975732f6c61726176656c2d6261636b7061636b2d637275642d657874656e6465642e7376673f6d61784167653d31383030267374796c653d666c61742d737175617265)](https://github.com/novius/laravel-backpack-crud-extended#licence)

This package extends [Backpack/CRUD](https://github.com/laravel-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
-----------------

[](#table-of-contents)

- [Installation](#installation)
    - [Publish views](#publish-views)
    - [Configuration](#configuration)
- [Usage &amp; Features](#usage--features)
    - [Permissions](#permissions)
    - [CRUD Boxes](#crud-boxes)
    - [Fields Drivers](#fields-drivers)
    - [Language / i18n](#language--i18n)
    - [Upload Field : UploadableFile Trait](#upload-field--uploadablefile-trait)
    - [Upload Field : file\_upload\_crud validation rule](#upload-field--file_upload_crud-validation-rule)
    - [Image Field : UploadableImage Trait](#image-field--uploadableimage-trait)
    - [CRUD : custom routes](#crud--custom-routes)
- [Testing](#testing)
- [Lint](#lint)
- [Contributing](#contributing)
- [Licence](#licence)

Installation
------------

[](#installation)

In your terminal:

```
composer require novius/laravel-backpack-crud-extended
```

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:

```
'providers' => [
    ...
    Novius\Backpack\CRUD\CrudServiceProvider::class,
];
```

### Publish views

[](#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:

```
php artisan vendor:publish --provider="Novius\Backpack\CRUD\CrudServiceProvider" --force
```

### Configuration

[](#configuration)

Some options that you can override are available.

```
php artisan vendor:publish --provider="Novius\Backpack\CRUD\CrudServiceProvider" --tag="config"
```

Usage &amp; Features
--------------------

[](#usage--features)

### Permissions

[](#permissions)

#### Description

[](#description)

- Permissions can be applied automatically to CRUD Controllers : deny access if user hasn't the permission linked to the route =&gt; `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) =&gt; `create_permissions_while_browsing` option
- Permissions can be automatically given to the logged user (useful in local environment) =&gt; `give_permissions_to_current_user_while_browsing` option

#### Requirements

[](#requirements)

- This feature require : [Laravel-Backpack/PermissionManager](https://github.com/Laravel-Backpack/PermissionManager)
- You have to publish config file :

```
php artisan permissions:generate // Insert permissions in database for each CRUD controllers.
```

- Set to true each options that you want activate

#### Usage

[](#usage)

Your CrudController must extend `\Novius\Backpack\CRUD\Http\Controllers\CrudController`

### CRUD Boxes

[](#crud-boxes)

You can now split your create/edit inputs into multiple boxes.

[![backpack-crud-boxes](https://user-images.githubusercontent.com/1242207/29535541-7d14ca06-86ba-11e7-8ba6-303b2b99924b.png)](https://user-images.githubusercontent.com/1242207/29535541-7d14ca06-86ba-11e7-8ba6-303b2b99924b.png)

In order to use this feature, you just need to specify the box name for each of your fields.

```
$this->crud->addField([
    'name' => 'title',
    'label' => "My Title",
    'type' => 'text',
    'box' => 'Box name here'
]);
```

You can also specify some options to each box:

```
$this->crud->setBoxOptions('Details', [
    'side' => true,         // Place this box on the right side?
    'class' => "box-info",  // CSS class to add to the div. Eg,
    'collapsed' => true,    // Collapse this box by default?
]);
```

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.

```
$this->crud->setDefaultBox('YourBoxName');
```

### Fields Drivers

[](#fields-drivers)

Fields type can now be a classname:

```
$this->crud->addField([
    'name' => 'username',
    'label' => "My username",
    'type' => \My\Other\Package\Field\Foo::class,
]);
```

This allows you to propose new field types in external packages. Your Field class must implement Field Contract.

### Language / i18n

[](#language--i18n)

Set a custom dictionary for a specific crud:

```
$this->crud->setLangFile('backpack::crud/movie');
```

This dictionary will then be used in the CRUD views.

You can use it in your own views like this:

```
{{ trans($crud->getLangFile().'.add') }}
```

### Upload Field : `UploadableFile` Trait

[](#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:

```
// Article Model

class Article extends \Backpack\NewsCRUD\app\Models\Article
{
    use Sluggable, SluggableScopeHelpers;
    use HasTranslations;
    use UploadableFile;

    protected $fillable = ['slug', 'title', 'content', 'image', 'status', 'category_id', 'featured', 'date', 'document', 'document_2'];
    protected $translatable = ['slug', 'title', 'content'];

    public function uploadableFiles(): array
    {
        return [
            ['name' => 'document'],
            ['name' => 'document_2', 'slug' => 'title']
        ];
    }
}
```

```
// ArticleCrudController

$this->crud->addField([
    'label' => 'Image',
    'name' => 'image',
    'type' => 'image',
    'upload' => true,
    'crop' => true, // set to true to allow cropping, false to disable
    'aspect_ratio' => 0, // ommit or set to 0 to allow any aspect ratio
    'prefix' => '/storage/',
]);

$this->crud->addField([
    'label' => 'Document',
    'name' => 'document',
    'type' => 'upload',
    'upload' => true,
    'prefix' => '/storage/',
]);

$this->crud->addField([
    'label' => 'Document 2',
    'name' => 'document_2',
    'type' => 'upload',
    'upload' => true,
    'prefix' => '/storage/',
]);
```

### Upload Field : `file_upload_crud` validation rule

[](#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:

```
public function rules()
{
    return [
        'name' => 'required|min:2|max:191',
        'document' => 'file_upload_crud:pdf,docx', // the parameters must be valid mime types
    ];
}

public function messages()
{
    return [
        'file_upload_crud' => 'The :attribute must be a valid file.',
    ];
}
```

### Image Field : `UploadableImage` Trait

[](#image-field--uploadableimage-trait)

If you use the [Image CRUD Field](https://laravel-backpack.readme.io/docs/crud-fields#section-image), you can implement this trait on your model to automatically manage saving and deleting the image on the server.

Example:

```
namespace App\Models;

use Backpack\CRUD\CrudTrait;
use Illuminate\Database\Eloquent\Model;
use Novius\Backpack\CRUD\ModelTraits\UploadableImage;

class Example extends Model
{
    use CrudTrait;
    use UploadableImage;

    protected $fillable = ['title', 'image', 'thumbnail'];

    public function uploadableImages()
    {
        return [
            [
                'name' => 'image', // The attribute name where to store the image path
                'slug' => 'title', // The attribute name from which to generate the image file name (optionnal)
            ],
            [
                'name' => 'thumbnail',
            ],
        ];
    }
}
```

If you want to perform some custom actions on your image after saving or deleting it :

```
namespace App\Models;

use Backpack\CRUD\CrudTrait;
use Illuminate\Database\Eloquent\Model;
use Novius\Backpack\CRUD\ModelTraits\UploadableImage;

class Example extends Model
{
    use CrudTrait;
    use UploadableImage {
        imagePathSaved as imagePathSavedNative;
        imagePathDeleted as imagePathDeletedNative;
    }

    protected $fillable = ['title', 'image', 'thumbnail'];

    public function uploadableImages()
    {
        return [
            [
                'name' => 'image', // The attribute name where to store the image path
                'slug' => 'title', // The attribute name from which to generate the image file name (optionnal)
            ],
            [
                'name' => 'thumbnail',
            ],
        ];
    }

    /**
     * Callback triggered after image saved on disk
     */
    public function imagePathSaved(string $imagePath, string $imageAttributeName = null, string $diskName = null)
    {
        if (!$this->imagePathSavedNative()) {
            return false;
        }

        // Do what you want here

        return true;
    }

    /**
     * Callback triggered after image deleted on disk
     */
    public function imagePathDeleted(string $imagePath, string $imageAttributeName = null, string $diskName = null)
    {
        if (!$this->imagePathDeletedNative()) {
            return false;
        }

        // Do what you want here

        return true;
    }
}
```

#### MediaLibrary

[](#medialibrary)

If you want to store the images in the [MediaLibrary](https://github.com/spatie/laravel-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

[](#translations)

Both traits `UploadableImage` and `SpatieMediaLibrary\UploadableImage` are compatible with the [translation package](https://github.com/spatie/laravel-translatable) 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

[](#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 :

```
// Set a custom index route
$this->crud->setIndexRoute('crud.slide.index', ['slideshow' => (int) request('slideshow')]);

// Set a custom reorder route
$this->crud->setReorderRoute('crud.slide.reorder', ['slideshow' => (int) request('slideshow')]);
```

Testing
-------

[](#testing)

Run the tests with:

```
./test.sh
```

Lint
----

[](#lint)

Run php-cs with:

```
./cs.sh
```

Contributing
------------

[](#contributing)

Contributions are welcome! Leave an issue on Github, or create a Pull Request.

Licence
-------

[](#licence)

This package is under [GNU Affero General Public License v3](http://www.gnu.org/licenses/agpl-3.0.html) or (at your option) any later version.

However, this package requires [Backpack\\CRUD](http://github.com/laravel-backpack/crud), which is under YUMMY license: if you use it in a commercial project, you have to [buy a backpack license](https://backpackforlaravel.com/pricing).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~32 days

Recently: every ~124 days

Total

22

Last Release

2514d ago

PHP version history (2 changes)0.1.0PHP &gt;=7.0

0.3.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/f743a4ad47586fe6868c94f04cacf5648c05bf04aa447e098775eba5d0e7b0cc?d=identicon)[badawy](/maintainers/badawy)

---

Top Contributors

[![jguyomard](https://avatars.githubusercontent.com/u/1242207?v=4)](https://github.com/jguyomard "jguyomard (14 commits)")[![tony-novius](https://avatars.githubusercontent.com/u/243603340?v=4)](https://github.com/tony-novius "tony-novius (9 commits)")[![shaoshiva](https://avatars.githubusercontent.com/u/2183266?v=4)](https://github.com/shaoshiva "shaoshiva (8 commits)")[![tonyyb](https://avatars.githubusercontent.com/u/11064382?v=4)](https://github.com/tonyyb "tonyyb (5 commits)")[![wprod](https://avatars.githubusercontent.com/u/5948150?v=4)](https://github.com/wprod "wprod (4 commits)")[![badawys](https://avatars.githubusercontent.com/u/515770?v=4)](https://github.com/badawys "badawys (2 commits)")[![cholletNovius](https://avatars.githubusercontent.com/u/17598922?v=4)](https://github.com/cholletNovius "cholletNovius (2 commits)")

---

Tags

laravelcrudbackpackNovius

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/elbadawy-laravel-backpack-crud-extended/health.svg)

```
[![Health](https://phpackages.com/badges/elbadawy-laravel-backpack-crud-extended/health.svg)](https://phpackages.com/packages/elbadawy-laravel-backpack-crud-extended)
```

###  Alternatives

[novius/laravel-backpack-crud-extended

This package extends Laravel Backpack\\CRUD

619.1k2](/packages/novius-laravel-backpack-crud-extended)[backpack/pagemanager

Create admin panels for presentation websites on Laravel, using page templates and Backpack\\CRUD.

371522.6k6](/packages/backpack-pagemanager)[backpack/backupmanager

Admin interface for managing backups in Backpack, on Laravel 5.2+

340375.9k2](/packages/backpack-backupmanager)[novius/laravel-backpack-visualcomposer

This packages provides an interface to manage page content easily

113.5k](/packages/novius-laravel-backpack-visualcomposer)[ziming/json-field-for-backpack

A Json Editor Field for Backpack

3597.3k](/packages/ziming-json-field-for-backpack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
