Download the PHP package andrechalom/laravel-multiselect without Composer

On this page you can find all versions of the php package andrechalom/laravel-multiselect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-multiselect

Package Laravel-Multiselect

Latest Version on Packagist Total Downloads

This package provides a quick interface for adding select boxes from which multiple elements may be selected. The interface is similar to the Laravel Collective HTML package, and aims to be compatible with it. However, you can use this library without Laravel Collective's HTML.

This package adheres to PSR 1, 2 and 4.

Requirements

Install

Via Composer

Service Provider & Facade

Register provider and facade on your config/app.php file. This is necessary for Laravel 5.4, but optional for >= 5.5.

Javascript Configuration

The jQuery code required by this package is in the file multiselect.js. If you use Laravel Mix, you can include it in your mix.js. Otherwise, copy it to your public folder and source it directly in the app layout. Remember to do it after you include jQuery.

Example:

Basic Usage

(1) The default behavior creates a select element with an area where the selected options are placed. Use any key => value array to populate the select.

To provide initial selected options, pass a list of keys as the third argument. All keys in this argument are supposed to be in the options list (but see "Advanced usage" below):

This can be populated from Eloquent models:

(2) In the Controller, the selected options will be in a array.

(3) style: the span elements generated with Multiselect are of the "multiselector" css class. You can style them as you like, for instance

A css file is included in this package source code, and includes the above, plus all of the elements that should be styled when using this package.

If would like to change the class or other HTML attributes of the select, option or span elements generated, use the following arguments:

Note that the argument for options excepts an array with the same size of the $list parameter. Also note that if you change the select class, you must append "multiselect" or the Javascript code won't work.

Advanced usage

(1) A more advanced usage involves generating the select and span elements separately. To do so, use the $selectOnly argument on the select function.

Notice that you must pass the exact same arguments as $list and $selected for both functions.

(2) When a value passed as default to the span function is not found in the $list argument, the function generates an element with "Undefined" as label. You can change this behavior to throwing and exception using the last argument of the span function (strict mode).

(3) Unlike in LaravelCollective's select, a placeholder option is always generated. You can customize its label using

(4) You can also use an autocomplete input instead of a select element! To do so, import devbridge's Autocomplete plugin, replace the calls to Multiselect::select() to Multiselect::autocomplete(), and include a Multiselect::scripts() call after jQuery is loaded.

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

Contributing

Please see CODE_OF_CONDUCT for details.

Security

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

Credits

The idea behind the Multiselect is based on an article by Michał Wojciechowski. This library reuses some code from Laravel Collective HTML.

License

This work is licensed under the GNU Public License. Please see License File for more information.


All versions of laravel-multiselect with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version >=5.1 <9.0
illuminate/http Version >=5.1 <9.0
php Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package andrechalom/laravel-multiselect contains the following files

Loading the files please wait ....