Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xiaohuilam/laravel-admin-select2

๐’‚๐’”๐’š๐’๐’„ ๐’”๐’†๐’๐’†๐’„๐’•/๐’Ž๐’๐’“๐’‘๐’‰๐‘บ๐’†๐’๐’†๐’„๐’• ๐’‡๐’๐’“ ๐’๐’‚๐’“๐’‚๐’—๐’†๐’ ๐’‚๐’…๐’Ž๐’Š๐’
https://github.com/xiaohuilam/laravel-admin-select2

laravel laravel-admin laravel-admin-extension php select2

Last synced: about 1 month ago
JSON representation

๐’‚๐’”๐’š๐’๐’„ ๐’”๐’†๐’๐’†๐’„๐’•/๐’Ž๐’๐’“๐’‘๐’‰๐‘บ๐’†๐’๐’†๐’„๐’• ๐’‡๐’๐’“ ๐’๐’‚๐’“๐’‚๐’—๐’†๐’ ๐’‚๐’…๐’Ž๐’Š๐’

Awesome Lists containing this project

README

        

๐‘ณ๐’‚๐’“๐’‚๐’—๐’†๐’-๐‘จ๐’…๐’Ž๐’Š๐’ ๐’”๐’†๐’๐’†๐’„๐’•2 ๐’‚๐’”๐’š๐’๐’„๐’‰๐’“๐’๐’๐’๐’–๐’” ๐’†๐’™๐’•๐’†๐’๐’”๐’Š๐’๐’

[![travis.svg](https://img.shields.io/travis/xiaohuilam/laravel-admin-select2/master.svg)](https://travis-ci.org/xiaohuilam/laravel-admin-select2)
[![version.svg](https://img.shields.io/packagist/vpre/xiaohuilam/laravel-admin-select2.svg)](https://packagist.org/packages/xiaohuilam/laravel-admin-select2)
[![issues-open.svg](https://img.shields.io/github/issues/xiaohuilam/laravel-admin-select2.svg)](https://github.com/xiaohuilam/laravel-admin-select2/issues)
[![install-count.svg](https://img.shields.io/packagist/dt/xiaohuilam/laravel-admin-select2.svg)](https://packagist.org/packages/xiaohuilam/laravel-admin-select2)
[![license.svg](https://img.shields.io/github/license/xiaohuilam/laravel-admin-select2.svg)](LICENSE)

*. Deprecated, please use [dcat/laravel-admin](https://github.com/jqhph/dcat-admin) instead!

## About

ไธญๆ–‡็”จๆˆท่ฏท้˜…่ฏป [ไธญๆ–‡ๆ–‡ๆกฃ](README_cn.md).

A asynchronous extension to implements select2 to [laravel-admin](http://github.com/z-song/laravel-admin/), including single select/multiple select/morph select.

It will send ajax query if only you trigger list option in the form.

*. extends from laravel-admin's original select, multipleSelect Fields, so it's compatible with laravel-admin select field.

## Installation
```bash
composer require xiaohuilam/laravel-admin-select2
```

publish assets
```bash
php artisan vendor:publish --tag=laravel-admin-select2
```

## Usage

- [asynchronous single select (`select`) demo](tests/Controllers/AnswerController.php#L35-L59)
- [asynchronous multiple select (`multipleSelect`) demo](tests/Controllers/QuestionController.php#L35-L59)
- [asynchronous morph select (`morphSelect`) demo](tests/Controllers/CommentController.php#L34-L51)
- [asynchronous select filter (`filterSelect2`) demo](tests/Controllers/AnswerController.php#L68-L77)

## Structure
```
src
โ”œโ”€โ”€ Form
โ”‚ โ””โ”€โ”€ Field
โ”‚ โ”œโ”€โ”€ Select.php # `LaravelAdminExt\Select2\Form\Field\Select` single select class
โ”‚ โ”œโ”€โ”€ MultipleSelect.php # `LaravelAdminExt\Select2\Form\Field\MultipleSelect` multiple select class
โ”‚ โ””โ”€โ”€ MorphSelect.php # `LaravelAdminExt\Select2\Form\Field\MorphSelect` morph select class
โ”œโ”€โ”€ Interfaces
โ”‚ โ””โ”€โ”€ MorphSelectInterface.php # `LaravelAdminExt\Select2\Interfaces\MorphSelectInterface` morph select interface. must implement in every morphed models.
โ”œโ”€โ”€ Select2.php # laravel-admin extension identify file
โ”œโ”€โ”€ Select2ServiceProvider.php # laravel service provider
โ””โ”€โ”€ Traits # some multiplexing methods
โ”œโ”€โ”€ FormTrait.php
โ””โ”€โ”€ Select2Trait.php
```

## Donation
[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.me/laravel)

## LICENSE

Open source under [MIT](LICENSE) LICENSE.