Skip to content

Commit 7b1b8fd

Browse files
committed
Updates to documentation
1 parent 2740b9d commit 7b1b8fd

File tree

3 files changed

+52
-55
lines changed

3 files changed

+52
-55
lines changed

README.md

+11-55
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,22 @@ There are no real limits on what characters can be used in a tag. It uses a slug
1616
#### Composer Install (for Laravel 5+/Lumen 5)
1717

1818
```shell
19-
composer require rtconner/laravel-tagging "~3.1"
19+
composer require rtconner/laravel-tagging "~3.2"
2020
```
2121

2222
#### Install and then Run the migrations
2323

24-
The service provider does not load on every page load, so it should not slow down your app. In `config/app.php` You may add the `TaggingServiceProvider` in the providers array as follows:
24+
The package should auto-discover when you composer update. Then publish the tagging.php and run the database migrations with these commands.
2525

26-
> If you're using Laravel 5.5+ let the package auto discovery make this for you.
27-
28-
```php
29-
'providers' => [
30-
\Conner\Tagging\Providers\TaggingServiceProvider::class,
31-
];
32-
```
33-
Then publish the configurations and migrations by:
3426
```bash
3527
php artisan vendor:publish --provider="Conner\Tagging\Providers\TaggingServiceProvider"
3628
php artisan migrate
3729
```
3830

39-
###### Lumen 5 Installation
40-
41-
Lumen does not have a vendor:publish command, so you will need to create or copy the provided migrations and config file into their respective directory.
42-
43-
In app\bootstrap\app.php
44-
45-
```php
46-
// Add this line in your config section
47-
$app->configure('tagging');
48-
// Add this line in your service provider section
49-
$app->register(Conner\Tagging\Providers\LumenTaggingServiceProvider::class);
50-
```
51-
52-
After these two steps are done, you can edit config/tagging.php with your prefered settings.
53-
5431
#### Setup your models
5532
```php
56-
class Article extends \Illuminate\Database\Eloquent\Model {
33+
class Article extends \Illuminate\Database\Eloquent\Model
34+
{
5735
use \Conner\Tagging\Taggable;
5836
}
5937
```
@@ -87,43 +65,21 @@ Conner\Tagging\Model\Tag::where('count', '>', 2)->get(); // return all tags used
8765
Article::existingTags(); // return collection of all existing tags on any articles
8866
```
8967

90-
[More examples in the documentation](docs/usage-examples.md)
91-
92-
93-
### Tag Groups
94-
95-
You can create groups with the following artisan command
96-
97-
```php
98-
php artisan tagging:create-group MyTagGroup
99-
```
100-
101-
Set the tag group for a tag
102-
103-
```php
104-
$tag->setGroup('MyTagGroup');
105-
```
68+
[Documentation: More Usage Examples](docs/usage-examples.md)
10669

107-
To get all the tags in a certain group
70+
[Documentation: Tag Groups](docs/tag-groups.md)
10871

109-
```php
110-
Tag::inGroup('MyTagGroup')->get()
111-
```
112-
113-
Check if a tag is in a group
114-
115-
```php
116-
$tag->isInGroup('MyTagGroup');
117-
```
72+
[Documentation: Tagging Events](docs/events.md)
11873

74+
[Documentation: Tag Suggesting](docs/suggesting.md)
11975

12076
### Configure
12177

12278
[See config/tagging.php](config/tagging.php) for configuration options.
12379

124-
### Further Documentation
80+
###### Lumen Installation
12581

126-
[See the docs/ folder](docs) for more documentation.
82+
[Documentation: Lumen](docs/lumen.md)
12783

12884
#### Upgrading Laravel 4 to 5
12985

@@ -135,5 +91,5 @@ Alternatively you can override Model::$morphClass on your model class to match t
13591
- Robert Conner - http://smartersoftware.net
13692

13793
#### Further Reading
138-
- [Laravel News article on tagging with this library](https://laravel-news.com/2015/10/how-to-add-tagging-to-your-laravel-app/)
94+
- [Laravel News article on tagging with this library](https://laravel-news.com/how-to-add-tagging-to-your-laravel-app)
13995
- [3rd Party Posting on installation with Twitter Bootstrap 2.3](http://blog.stickyrice.net/archives/2015/laravel-tagging-bootstrap-tags-input-rtconner)

docs/lumen.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Lumen Installation
2+
============
3+
4+
Lumen does not have a vendor:publish command, so you will need to create or copy the provided migrations and config file into their respective directory.
5+
6+
In app\bootstrap\app.php
7+
8+
```php
9+
// Add this line in your config section
10+
$app->configure('tagging');
11+
// Add this line in your service provider section
12+
$app->register(Conner\Tagging\Providers\LumenTaggingServiceProvider::class);
13+
```
14+
15+
After these two steps are done, you can edit config/tagging.php with your preferred settings.

docs/tag-groups.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Tag Groups
2+
============
3+
4+
TagGroups are a simple feature that let you group a set of tags together
5+
6+
```php
7+
php artisan tagging:create-group MyTagGroup
8+
```
9+
10+
Set the tag group for a tag
11+
12+
```php
13+
$tag->setGroup('MyTagGroup');
14+
```
15+
16+
To get all the tags in a certain group
17+
18+
```php
19+
Tag::inGroup('MyTagGroup')->get()
20+
```
21+
22+
Check if a tag is in a group
23+
24+
```php
25+
$tag->isInGroup('MyTagGroup');
26+
```

0 commit comments

Comments
 (0)