Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bedus-creation/laraveltaggable
Provide Categories and Tags to any laravel Models.
https://github.com/bedus-creation/laraveltaggable
categoiries laravel-category laravel-tags tags
Last synced: 3 months ago
JSON representation
Provide Categories and Tags to any laravel Models.
- Host: GitHub
- URL: https://github.com/bedus-creation/laraveltaggable
- Owner: bedus-creation
- Created: 2020-03-22T11:12:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-16T16:33:17.000Z (almost 2 years ago)
- Last Synced: 2024-05-05T13:01:50.925Z (9 months ago)
- Topics: categoiries, laravel-category, laravel-tags, tags
- Language: PHP
- Homepage:
- Size: 8.36 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
### Introduction
Category and Tags are often useful while working working with Laravel Model. This solution enable categories and tags for any Models in Laravel. Here step by step setup is given below.### Content
1. [Installtion](https://github.com/bedus-creation/LaravelTaggable#step1-installation)
2. [Publish Assets and Migration](https://github.com/bedus-creation/LaravelTaggable#step2-publish-migrations-assets)
3. [Use Trait in model](https://github.com/bedus-creation/LaravelTaggable#step3-use-traits)
4. [Call from anywhere](https://github.com/bedus-creation/LaravelTaggable#step4-call-from-anywhere)
5. [Display in blade](https://github.com/bedus-creation/LaravelTaggable#step5-display-in-blade)
### Step1: Installation
```php
composer require aammui/laravel-taggable
```### Step2: Publish Migrations assets
```
php artisan vendor:publish --provider="Aammui\LaravelTaggable\LaravelTaggableServiceProvider"
php artisan migrate
```### Step3: Use Traits
Add ```HasCatgory``` and ```HasTag``` Traits in your model.
```php
'Post']);
$post->addTag('Tags');
$post->addTag(['Tags','Category']);
$post->addCategory('Category');
$post->addCategory(['Category', 'Laravel Category']);
```### Step5: Display In Blade
```blade.php
- {{$item->name}}
@foreach($posts->category as $item)
@endforeach
```