Skip to content

Commit 0090336

Browse files
authored
Merge pull request #153 from JimChenWYU/master
Add `config` publish command
2 parents 0809584 + 5078262 commit 0090336

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto
2+
3+
/tests export-ignore
4+
/.github export-ignore
5+
.gitattributes export-ignore
6+
.gitignore export-ignore
7+
phpunit.xml export-ignore
8+
phpunit.xml.dist export-ignore
9+
.php_cs export-ignore
10+
.travis.yml export-ignore

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
$ composer require overtrue/laravel-follow -vvv
2929
```
3030

31+
### Configuration
32+
33+
This step is optional
34+
35+
```php
36+
$ php artisan vendor:publish --provider="Overtrue\\LaravelFollow\\FollowServiceProvider" --tag=config
37+
```
38+
3139
### Migrations
3240

3341
This step is also optional, if you want to custom the pivot table, you can publish the migration files:

config/follow.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
return [
4+
/*
5+
* Table name for followers records.
6+
*/
7+
'relation_table' => 'user_follower',
8+
];

src/FollowServiceProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ class FollowServiceProvider extends ServiceProvider
2323
*/
2424
public function boot()
2525
{
26+
$this->publishes([
27+
\dirname(__DIR__) . '/config/follow.php' => config_path('follow.php'),
28+
], 'config');
29+
2630
$this->publishes([
2731
\dirname(__DIR__) . '/migrations/' => database_path('migrations'),
2832
], 'migrations');

0 commit comments

Comments
 (0)