Download the PHP package codekinz/livewire-easy-tags without Composer
On this page you can find all versions of the php package codekinz/livewire-easy-tags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codekinz/livewire-easy-tags
More information about codekinz/livewire-easy-tags
Files in codekinz/livewire-easy-tags
Package livewire-easy-tags
Short Description A Laravel tag system for artisans which is built in Livewire, Laravel Spatie tags, Tagify and Alpine Js.
License MIT
Informations about the package livewire-easy-tags
Livewire Easy Tags
Livewire Easy Tags is a powerful and convenient package that enhances the Livewire experience by simplifying the process of working with tags and tag inputs. With this package, you can easily integrate tags functionality into your Livewire components, allowing users to add, edit, remove tags and add colors to tags effortlessly.
Installation
To install Livewire Easy Tags, use Composer:
Prerequisite
- Laravel 7.x or higher
- Livewire 2.x or higher
- Alpine Js 3.x or higher
- Tagify 3.x or higher
- Tailwind 2.x or higher
Getting Started
Setup
- After installing the package via Composer, you may need to add the service provider to your
config/app.php
file:
Publish the migration and config files
Run the migration
Set up the Livewire component
In order to use Livewire easy tags, you will first need to create a Livewire component
In Livewire Tags component, instead of extending the Livewire class you will need to extend the LivewireEasyTags
. You Tags component should look like this
Add trait to Laravel Model
This package uses Laravel Spatie Tags as an underlying package. So, in order to use its functionality, you need to use this Trait HasSpatieTags
in your model class.
Usage
Now we are good to go. We just need to call our Livewire component in a blade file.
Here is the explanation of parameters
modelClass
is the class of the model that you want to associate with the tagmodelId
is the record identifier i.e primary key valuetagType
allows you to set up tags for multiple modules. For instance, you need to use tags for multiple modules like travel, bookings and flights then thetagType
parameter will serve the purpose.
Configurations
Configurations are available at config/livewire-easy-tags.php
. You can change the configuration in this file globally or you can use this function in your Tags
component if you want to have multiple tags component
FAQs
Q. How to add or change colors of tags?
A. If you click on any tag you will see a dropdown containing the list of colors and a delete button. Choose any color and you will see the effect
Q. How to delete a tag permenantly?
A. Just like previously, you need to click on the tag you will see a dropdown containing list of colors and a delete button. Click on the delete button to remove that tag permanently.
Q. How to edit a tag?
A. Double click on a tag and edit it.
Main Contributor
License
Livewire Easy Tags is open-source software licensed under the MIT license and powered by Codekinz