dodsoftware/dynamic-field-hints-for-backpack

Easily add field hints to Backpack CRUD fields from database comments.

1.0.0 2020-09-14 10:35 UTC

This package is auto-updated.

Last update: 2022-11-17 13:34:52 UTC


README


68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646f64736f6674776172652f64796e616d69632d6669656c642d68696e74732d666f722d6261636b7061636b2e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646f64736f6674776172652f64796e616d69632d6669656c642d68696e74732d666f722d6261636b7061636b2e7376673f7374796c653d666c61742d737175617265 68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f646f64736f6674776172652f44796e616d69634669656c6448696e7473466f724261636b7061636b

Dynamic Field Hints for Backpack 4

This package extends the Backpack for Laravel CrudPanel providing the ability to dynamically set the 'hint' value for its CRUD fields by pulling the "comment" for the related column in the database if it exists.

Notes

  • hints are only set if the method is called
  • hints are only set if the column in the db has a Comment
  • hints are not set if a hint already exists on the field
  • hints are not set if "hint" on the field is set to an empty string

Installation

Via Composer

composer require dodsoftware/dynamic-field-hints-for-backpack

If you've disabled Laravel's auto package discovery, you'll need to also add the below to your app's config/app.php file

'providers' => [
    // ...
    DoDSoftware\DynamicFieldHintsForBackpack\AddonServiceProvider::class,
];

Usage

Inside your custom CrudController:

    $this->crud->addFields($fields);
    $this->crud->setFieldHintsFromColumnComments();

Supported Databases

  • MySQL 5.6+
  • PostgreSQL 9.4+
  • SQL Server 2017+

Change log

Please see the changelog for more information on what has changed recently.

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email the author instead of using the issue tracker.

Credits

License

MIT. Please see the license file for more information.