Download the PHP package blockpc/select2-wire without Composer

On this page you can find all versions of the php package blockpc/select2-wire. 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 select2-wire

Select2 Wire

read plis

This package is old... i found that create a select2 for laravel its very simple, checkout this git https://gist.github.com/blockpc/5878e8d02b1fa33a9e13ab912e9a6440 now the gist is old version, but how to explain depends each one, the basic is the same

old version

This package create a select2 livewire component via commands. The package is built under a TALL stack. Make sure you have the requirements (see composer.json) One command creates a livewire component as well as its view, plus it gives you the option to create a trait to receive basic events on a parent component.

Installation

Commands

Single component Create a component that works as a single selectable, allows you to add data on the fly

Multiple component Create a component that works as a multiple selectable, allows you to add data on the fly, data must be separated by commas

Delete component This commando delete a component created

Single Component Foo

This command create a single component select2 class (under directory app Livewire/Select2/FooSelect2.php) and one view (under directory resource livewire/select2/foo-select2.blade.php) with a model Foo related.

Single Component Foo with model Baz

This command create a single component select2 class (under directory app Livewire/Select2/FooSelect2.php) and one view (under directory resource livewire/select2/foo-select2.blade.php) with a model Baz related.

Single Component Foo with model Baz and parent model Taz

This is the suggested command. It has the same behavior as the others but adds some events (and listeners) that allow you to interact with a foreign component (ex CRUD). It also allows you to create a trait to help you in this.

This command create a single component select2 class (under directory app Livewire/Select2/FooSelect2.php) and one view (under directory resource livewire/select2/foo-select2.blade.php) with a model Baz related and parent model Taz, Gives you the option to create a trait if you need to interact with an external component (under directory app Livewire/Select2/Traits/SingleSelect2.php)

Multiple Component Foo

This command create a multiple component select2 class (under Livewire/Select2/FooSelect2.php directory app) and one view (under directory resource livewire/select2/foo-select2.blade.php) with a model Foo related.

Multiple Component Foo with model Baz

This command create a multiple component select2 class (under directory app Livewire/Select2/FooSelect2.php) and one view (under directory resource livewire/select2/foo-select2.blade.php) with a model Baz related.

Multiple Component Foo with model Baz and parent model Taz

This is the suggested command. It has the same behavior as the others but adds some events (and listeners) that allow you to interact with a foreign component (ex CRUD). It also allows you to create a trait to help you in this.

This command create a multiple component select2 class (under directory app Livewire/Select2/FooSelect2.php) and one view (under directory resource livewire/select2/foo-select2.blade.php) with a model Baz related and parent model Taz, Gives you the option to create a trait if you need to interact with an external component (under directory app Livewire/Select2/Traits/MultipleSelect2.php)

Usage

Let's suppose

Our company sells vehicles and each vehicle has one code, a brand and can be in various colors.

From what has been read above we understand that we have a parent model called vehicle. And each one has properties like one name, one brand and could be has many colors.

In the example directory you find all files you needs for this tutorial

Brand

The model brand have a relation one-to-one with parent model vehicle
One vehicle has one brand
This relation we called like single relation

Colors

The model color have a relation many-to-many with parent model vehicle One vehicle has many colors and one color can be set in many vehicles
This relation we called like multiple relation

Extra Migration

For a multiple relation we need a migration that creates the table that contains the foreign keys for color and vehicle models php artisan make:migration create_color_vehicle_table

you find all the migrations in example directory

run mingrations

Models

So, your parent model vehicle should look like this

Your single relation brand should look like this:

Your multiple relation colors should look like this:

Route and Controller

After this, we need a route and one controller

Commands needed

We run two commands

And we make sure to accept the creation of the traits. Then we add the components we created to use in the controller view. you can see the example and how it was structured.

enjoy

💖 Support the development

Do you like this project? Support it by donating

Select2-Wire is open-sourced software licensed under the MIT license.


All versions of select2-wire with dependencies

PHP Build Version
Package Version
Requires livewire/livewire Version ^2.6
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 blockpc/select2-wire contains the following files

Loading the files please wait ....