figlabhq/crud-resource-for-backpack

Build CRUD panels using fluent field definitions.
2,330 12
Install
composer require figlabhq/crud-resource-for-backpack
Latest Version:v1.1.0
License:MIT
Last Updated:Jun 19, 2026
Links: GitHub  ·  Packagist
Maintainer: phpfour

CRUD Resource for Laravel Backpack

Latest Version on Packagist Total Downloads The Whole Fruit Manifesto

This package allows creating CRUD panels for Backpack for Laravel administration panel using fluent field definitions.

This is heavily inspired by Laravel Nova.

What does it offer?

  • Define Resources once, get all configurations ready for CRUD panels :rocket:
  • Get IDE hints - these are all PHP classes :wink:
  • Avoid long, nested, hard-to-remember array configurations :yawning_face:
  • Embrace the elegance of Object-Oriented API with Fluent Interface Pattern :gear:

Installation

Via Composer

composer require figlabhq/crud-resource-for-backpack

Usage

  1. Create a new class defining the fields required for your model. Here is how it'd look for standard Laravel User model:

    <?php declare(strict_types=1);
    
    namespace App\CrudResources;
    
    use FigLab\CrudResource\CrudResource;
    use App\Models\User;
    use FigLab\CrudResource\Fields\Email;
    use FigLab\CrudResource\Fields\Password;
    use FigLab\CrudResource\Fields\Select;
    use FigLab\CrudResource\Fields\Text;
    
    class UserCrudResource extends CrudResource
    {
        public function fields(): array
        {
            return [
                Text::make('Name')
                    ->sortable(),
    
                Email::make('Email'),
    
                Password::make('Password')
                    ->size(6)
                    ->onlyOnForms(),
    
                Password::make('Confirm Password', 'password_confirmation')
                    ->size(6)
                    ->onlyOnForms(),
            ];
        }
    }
    
    
  2. In your Crud controller, call the relevant methods:

    <?php declare(strict_types=1);
    
    namespace App\Http\Controllers;
    
    use App\CrudResources\User\UserCrudResource;
    
    class UserCrudController extends CrudController
    {
        private UserCrudResource $crudResource;
    
        public function setup()
        {
            $this->crud->setModel(\App\Models\User::class);
            $this->crud->setRoute(config('backpack.base.route_prefix') . '/users');
            $this->crud->setEntityNameStrings('user', 'users');
    
            $this->crudResource = new UserCrudResource($this->crud);
        }
    
        protected function setupListOperation(): void
        {
            $this->crudResource->buildList();
        }
    
        protected function setupCreateOperation(): void
        {
            $this->crud->setValidation(UserStoreRequest::class);
    
            $this->crudResource->buildCreateForm();
        }
    
        protected function setupUpdateOperation(): void
        {
            $this->crud->setValidation(UserUpdateRequest::class);
    
            $this->crudResource->buildUpdateForm();
        }
    }
    
  3. Enjoy a fully-functional CRUD panel 🎉

    User Listing

    User Create/Update

Documentation

Coming soon...stay tuned 😅

Change log

Changes are documented here on Github. Please see the Releases tab.

Contributing

Please see contributing.md for a todolist and how-tos.

Security

If you discover any security related issues, please email hello@figlab.io instead of using the issue tracker.

Credits

License

This project was released under MIT, 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.

Related Packages

backpack/medialibrary-uploaders

Helper functions to save files with spatie media library

100,064 13
tjventurini/crud-image

Trait for the handling of Backpack CRUD images.

3 1
backpack/backupmanager

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

404,905 336