promatik/create-dummy-operation-for-backpack

CreateDummyOperation adds a button to your CRUDs to create dummy entries based on your model factories

1.0.0 2021-01-04 13:39 UTC

This package is auto-updated.

Last update: 2024-04-04 21:09:11 UTC


README

Latest Version on Packagist Total Downloads The Whole Fruit Manifesto

This package provides Create Dummy Operation functionality for projects that use the Backpack for Laravel administration panel.
This package adds a button on your CRUD list view, to create dummy entries. It works on CRUDs whose Models use the hasFactory trait.

Screenshots

Backpack Create Dummy Operation Addon

Installation

Via Composer

composer require promatik/create-dummy-operation-for-backpack

Usage

To use the Operation this package provides, inside your custom CrudController add:

use \Promatik\CreateDummyOperation\Http\Controllers\Operations\CreateDummyOperation;

Configurations

To change the configs you must edit configs\backpack\crud.php adding createDummy array to operations.

'operations' => [
    ...
    'createDummy' => [
        // environments where the button should appear (default is ['local', 'testing'])
        'environment' => ['local'],

        // default value for the number of entries to be added (default is 25)
        'default' => 10,
    ],

Overwriting

If you need to change the translations or the button view, you can easily publish the files to your app, and modify those files any way you want. But please keep in mind that you will not be getting any updates on those files.

  • Publishing views:
php artisan vendor:publish --provider="Promatik\CreateDummyOperation\AddonServiceProvider" --tag="views"
  • Publishing translations:
php artisan vendor:publish --provider="Promatik\CreateDummyOperation\AddonServiceProvider" --tag="lang"

Change log

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

Testing

composer test

Contributing

Please see contributing.md for a todolist and howtos.

Security

If you discover any security related issues, please email promatik@gmail.com 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.