Skip to content

emrancu/onchange-load-dependant-field-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Backpack Fields: Onchange load dependant field options/data

Latest Version on Packagist Total Downloads

This package provides a dependantFieldOptions field type for the Backpack for Laravel administration panel. The dependantFieldOptions field allows admins to load options from provided source through provided method depending on-change in parent/specefic field.

Screenshots

Backpack Star Field Addon

Installation

Via Composer

composer require ogroosoft/onchange-load-dependant-field-data

Usage

Inside your CrudController:

CRUD::addField([
       'view_namespace' => 'ogroosoft-onchange-field-options::fields',
       'type' => "dependantFieldOptions",
       'dependency_name' => 'surah_id', // write (parent/specefic) field name, when the field's value will change then load this field options
       'label' => "Verse",
       'name' => 'verse_id',
       'source' => route('surah.verses'),
       'attribute' => 'verse_no', // option's key name for showing option label
      // 'source_method' => 'post', //  by default post
      // 'id' => 'field_id',
      // 'placeholder' => 'placeholder', // by default "-"
      // 'hint' => 'hint',
  ]);

Uninstall

composer remove ogroosoft/onchange-load-dependant-field-data

Security

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

License

MIT. Please see the license file for more information.

Developed by : AL EMRAN

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published