Installation and Setup | laravel-tags | Spatie

 SPATIE

  Laravel Tags
===============

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-tags](https://spatie.be/docs/laravel-tags/v3)  Installation and Setup

 Version   v4   v3

 Other versions for crawler [v4](https://spatie.be/docs/laravel-tags/v4) [v3](https://spatie.be/docs/laravel-tags/v3)

  Installation and Setup
- [ Introduction ](https://spatie.be/docs/laravel-tags/v3/introduction)
- [ Postcardware ](https://spatie.be/docs/laravel-tags/v3/postcardware)
- [ Requirements ](https://spatie.be/docs/laravel-tags/v3/requirements)
- [ Installation and Setup ](https://spatie.be/docs/laravel-tags/v3/installation-and-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-tags/v3/questions-and-issues)
- [ Changelog ](https://spatie.be/docs/laravel-tags/v3/changelog)
- [ About us ](https://spatie.be/docs/laravel-tags/v3/about-us)

Basic usage
-----------

- [ Using tags ](https://spatie.be/docs/laravel-tags/v3/basic-usage/using-tags)
- [ Retrieving tagged models ](https://spatie.be/docs/laravel-tags/v3/basic-usage/retrieving-tagged-models)

Advanced usage
--------------

- [ Adding translations ](https://spatie.be/docs/laravel-tags/v3/advanced-usage/adding-translations)
- [ Using types ](https://spatie.be/docs/laravel-tags/v3/advanced-usage/using-types)
- [ Sorting tags ](https://spatie.be/docs/laravel-tags/v3/advanced-usage/sorting-tags)
- [ Using your own tag model ](https://spatie.be/docs/laravel-tags/v3/advanced-usage/using-your-own-tag-model)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-tags                                                                                                                                                                                                                                    `

Installation and Setup
======================

You can install the package via composer:

```
composer require spatie/laravel-tags
```

The service provider will automatically be registered.

You can publish the migration with:

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

After the migration has been published you can create the `tags` and `taggables` tables by running the migrations:

```
php artisan migrate
```

You can optionally publish the config file with:

```
php artisan vendor:publish --provider="Spatie\Tags\TagsServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
