@@ -80,7 +80,7 @@ You can install the package via composer:
80
80
composer require chrisjk123/laravel-blogger
81
81
```
82
82
83
- You can publish the migrations with:
83
+ Publish the migrations with:
84
84
85
85
``` bash
86
86
php artisan vendor:publish --provider=" Chriscreates\Blog\BloggerServiceProvider" --tag=" migrations"
@@ -94,21 +94,34 @@ php artisan vendor:publish --provider="Chriscreates\Blog\BloggerServiceProvider"
94
94
```
95
95
96
96
This is the contents of the published config file, if your ` User ` class is
97
- within a different directory, you can change it here as well as the User primary key:
97
+ within a different directory or has a different primary key it can be changed here.
98
+
99
+ Furthermore, the settings for allowing commenting on posts is set here, the default
100
+ is set to true as well as guest commenting.
98
101
99
102
``` php
100
103
return [
101
104
/*
102
- * The default path to the User model in Laravel
105
+ * User: the default path to the User model in Laravel and primary key
106
+ */
107
+ 'user' => [
108
+ 'user_class' => \App\User::class,
109
+ 'user_key_name' => 'id',
110
+ ],
111
+
112
+ /*
113
+ * Post: allow commenting on posts / allow guest commenting on posts
103
114
*/
104
- 'user_class' => \App\User::class,
105
- 'user_key_name' => 'id',
115
+ 'posts' => [
116
+ 'allow_comments' => true,
117
+ 'allow_guest_comments' => true,
118
+ ],
106
119
];
107
120
```
108
121
109
122
## Local testing
110
123
111
- You can publish the factories with:
124
+ For testing purposes, you can publish the factories with:
112
125
113
126
``` bash
114
127
php artisan vendor:publish --provider=" Chriscreates\Blog\BloggerServiceProvider" --tag=" factories"
@@ -136,7 +149,7 @@ class User extends Authenticatable
136
149
// Retrieve the posts created by the user(s)
137
150
$user->posts;
138
151
139
- // Retrieve the comments created by the user(s)
152
+ // Retrieve the comments created by the guest/ user(s)
140
153
$user->comments;
141
154
```
142
155
0 commit comments