GithubHelp home page GithubHelp logo

jeffersonsimaogoncalves / spatie-laravel-tags-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from filamentphp/spatie-laravel-tags-plugin

0.0 0.0 0.0 127 KB

[READ ONLY] Subtree split of the Filament spatie/laravel-tags Plugin (see filamentphp/filament)

Home Page: https://github.com/filamentphp/filament

PHP 100.00%

spatie-laravel-tags-plugin's Introduction

Filament Spatie Tags Plugin

Installation

Install the plugin with Composer:

composer require filament/spatie-laravel-tags-plugin:"^3.0-stable" -W

If you haven't already done so, you need to publish the migration to create the tags table:

php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="tags-migrations"

Run the migrations:

php artisan migrate

You must also prepare your Eloquent model for attaching tags.

For more information, check out Spatie's documentation.

Form component

This guide assumes that you've already set up your model attach tags as per Spatie's documentation.

You may use the field in the same way as the original tags input field:

use Filament\Forms\Components\SpatieTagsInput;

SpatieTagsInput::make('tags')

The field will automatically load and save its tags to your model. To set this functionality up, you must also follow the instructions set out in the field relationships section. If you're using the Panel Builder, you can skip this step.

Optionally, you may pass a type() allows you to group tags into collections:

use Filament\Forms\Components\SpatieTagsInput;

SpatieTagsInput::make('tags')
    ->type('categories')

The tags input supports all the customization options of the original tags input component.

Table column

This guide assumes that you've already set up your model attach tags as per Spatie's documentation.

To use the tags column:

use Filament\Tables\Columns\SpatieTagsColumn;

SpatieTagsColumn::make('tags')

Optionally, you may pass a type():

use Filament\Tables\Columns\SpatieTagsColumn;

SpatieTagsColumn::make('tags')
    ->type('categories')

The type allows you to group tags into collections.

The tags column supports all the customization options of the original tags column.

Infolist entry

This guide assumes that you've already set up your model attach tags as per Spatie's documentation.

To use the tags entry:

use Filament\Infolists\Components\SpatieTagsEntry;

SpatieTagsEntry::make('tags')

Optionally, you may pass a type():

use Filament\Infolists\Components\SpatieTagsEntry;

SpatieTagsEntry::make('tags')
    ->type('categories')

The type allows you to group tags into collections.

The tags entry supports all the customization options of the text entry.

spatie-laravel-tags-plugin's People

Contributors

danharrin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.