@@ -39,7 +39,7 @@ |
||
39 | 39 | ->orderBy('posted_at', 'desc'); |
40 | 40 | |
41 | 41 | if ($categoryID > 0) { |
42 | - $query->whereHas('categories', static function (Builder $query) use ($categoryID) { |
|
42 | + $query->whereHas('categories', static function(Builder $query) use ($categoryID) { |
|
43 | 43 | $query->where('blog_etc_post_categories.blog_etc_category_id', $categoryID); |
44 | 44 | })->get(); |
45 | 45 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function up(): void |
16 | 16 | { |
17 | - Schema::table('blog_etc_comments', static function (Blueprint $table) { |
|
17 | + Schema::table('blog_etc_comments', static function(Blueprint $table) { |
|
18 | 18 | $table->string('author_email')->nullable(); |
19 | 19 | $table->string('author_website')->nullable(); |
20 | 20 | }); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function down(): void |
27 | 27 | { |
28 | - Schema::table('blog_etc_comments', static function (Blueprint $table) { |
|
28 | + Schema::table('blog_etc_comments', static function(Blueprint $table) { |
|
29 | 29 | $table->dropColumn('author_email'); |
30 | 30 | $table->dropColumn('author_website'); |
31 | 31 | }); |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | */ |
17 | 17 | public function up(): void |
18 | 18 | { |
19 | - Schema::table('blog_etc_posts', static function (Blueprint $table) { |
|
19 | + Schema::table('blog_etc_posts', static function(Blueprint $table) { |
|
20 | 20 | $table->text('short_description')->nullable(); |
21 | 21 | }); |
22 | 22 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | public function down(): void |
28 | 28 | { |
29 | - Schema::table('blog_etc_posts', static function (Blueprint $table) { |
|
29 | + Schema::table('blog_etc_posts', static function(Blueprint $table) { |
|
30 | 30 | $table->dropColumn('short_description'); |
31 | 31 | }); |
32 | 32 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function up(): void |
16 | 16 | { |
17 | - Schema::create('blog_etc_uploaded_photos', static function (Blueprint $table) { |
|
17 | + Schema::create('blog_etc_uploaded_photos', static function(Blueprint $table) { |
|
18 | 18 | $table->increments('id'); |
19 | 19 | $table->text('uploaded_images')->nullable(); |
20 | 20 | $table->string('image_title')->nullable(); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | $table->timestamps(); |
25 | 25 | }); |
26 | - Schema::table('blog_etc_posts', static function (Blueprint $table) { |
|
26 | + Schema::table('blog_etc_posts', static function(Blueprint $table) { |
|
27 | 27 | $table->string('seo_title')->nullable(); |
28 | 28 | }); |
29 | 29 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | Schema::dropIfExists('blog_etc_uploaded_photos'); |
37 | 37 | |
38 | - Schema::table('blog_etc_posts', static function (Blueprint $table) { |
|
38 | + Schema::table('blog_etc_posts', static function(Blueprint $table) { |
|
39 | 39 | $table->dropColumn('seo_title'); |
40 | 40 | }); |
41 | 41 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | */ |
15 | 15 | public function up(): void |
16 | 16 | { |
17 | - Schema::create('blog_etc_posts', static function (Blueprint $table) { |
|
17 | + Schema::create('blog_etc_posts', static function(Blueprint $table) { |
|
18 | 18 | $table->increments('id'); |
19 | 19 | |
20 | 20 | $table->string('slug')->unique(); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $table->timestamps(); |
37 | 37 | }); |
38 | 38 | |
39 | - Schema::create('blog_etc_categories', static function (Blueprint $table) { |
|
39 | + Schema::create('blog_etc_categories', static function(Blueprint $table) { |
|
40 | 40 | $table->increments('id'); |
41 | 41 | |
42 | 42 | $table->string('category_name')->nullable(); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | }); |
49 | 49 | |
50 | 50 | // linking table: |
51 | - Schema::create('blog_etc_post_categories', static function (Blueprint $table) { |
|
51 | + Schema::create('blog_etc_post_categories', static function(Blueprint $table) { |
|
52 | 52 | $table->increments('id'); |
53 | 53 | |
54 | 54 | $table->unsignedInteger('blog_etc_post_id')->index(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $table->foreign('blog_etc_category_id')->references('id')->on('blog_etc_categories')->onDelete('cascade'); |
59 | 59 | }); |
60 | 60 | |
61 | - Schema::create('blog_etc_comments', static function (Blueprint $table) { |
|
61 | + Schema::create('blog_etc_comments', static function(Blueprint $table) { |
|
62 | 62 | $table->increments('id'); |
63 | 63 | |
64 | 64 | $table->unsignedInteger('blog_etc_post_id')->index(); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -Route::group(['middleware' => ['web'], 'namespace' => '\WebDevEtc\BlogEtc\Controllers'], static function () { |
|
3 | +Route::group(['middleware' => ['web'], 'namespace' => '\WebDevEtc\BlogEtc\Controllers'], static function() { |
|
4 | 4 | /* The main public facing blog routes - show all posts, view a category, rss feed, view a single post, also the add comment route */ |
5 | - Route::group(['prefix' => config('blogetc.blog_prefix', 'blog')], static function () { |
|
5 | + Route::group(['prefix' => config('blogetc.blog_prefix', 'blog')], static function() { |
|
6 | 6 | Route::get('/', 'PostsController@index')->name('blogetc.index'); |
7 | 7 | |
8 | 8 | Route::get('/search', 'PostsController@search')->name('blogetc.search'); |
@@ -13,13 +13,13 @@ discard block |
||
13 | 13 | |
14 | 14 | Route::get('/{blogPostSlug}', 'PostsController@show')->name('blogetc.single'); |
15 | 15 | |
16 | - Route::group(['middleware' => 'throttle:10,3'], static function () { |
|
16 | + Route::group(['middleware' => 'throttle:10,3'], static function() { |
|
17 | 17 | Route::post('save_comment/{blogPostSlug}', 'CommentsController@store')->name('blogetc.comments.add_new_comment'); |
18 | 18 | }); |
19 | 19 | }); |
20 | 20 | |
21 | 21 | /* Admin backend routes - CRUD for posts, categories, and approving/deleting submitted comments */ |
22 | - Route::group(['prefix' => config('blogetc.admin_prefix', 'blog_admin')], static function () { |
|
22 | + Route::group(['prefix' => config('blogetc.admin_prefix', 'blog_admin')], static function() { |
|
23 | 23 | Route::get('/', 'Admin\ManagePostsController@index')->name('blogetc.admin.index'); |
24 | 24 | |
25 | 25 | Route::get('/add_post', 'Admin\ManagePostsController@create')->name('blogetc.admin.create_post'); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | Route::patch('/edit_post/{blogPostId}', 'Admin\ManagePostsController@update')->name('blogetc.admin.update_post'); |
32 | 32 | |
33 | - Route::group(['prefix' => 'image_uploads'], static function () { |
|
33 | + Route::group(['prefix' => 'image_uploads'], static function() { |
|
34 | 34 | Route::get('/', 'BlogEtcImageUploadController@index')->name('blogetc.admin.images.all'); |
35 | 35 | |
36 | 36 | Route::get('/upload', 'BlogEtcImageUploadController@create')->name('blogetc.admin.images.upload'); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | Route::delete('/delete_post/{blogPostId}', 'Admin\ManagePostsController@destroy')->name('blogetc.admin.destroy_post'); |
42 | 42 | |
43 | - Route::group(['prefix' => 'comments'], static function () { |
|
43 | + Route::group(['prefix' => 'comments'], static function() { |
|
44 | 44 | Route::get('/', 'Admin\ManageCommentsController@index')->name('blogetc.admin.comments.index'); |
45 | 45 | |
46 | 46 | Route::patch('/{commentId}', 'Admin\ManageCommentsController@approve')->name('blogetc.admin.comments.approve'); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | Route::delete('/{commentId}', 'Admin\ManageCommentsController@destroy')->name('blogetc.admin.comments.delete'); |
49 | 49 | }); |
50 | 50 | |
51 | - Route::group(['prefix' => 'categories'], static function () { |
|
51 | + Route::group(['prefix' => 'categories'], static function() { |
|
52 | 52 | Route::get('/', 'Admin\ManageCategoriesController@index')->name('blogetc.admin.categories.index'); |
53 | 53 | |
54 | 54 | Route::get('/add_category', 'Admin\ManageCategoriesController@create')->name('blogetc.admin.categories.create_category'); |
@@ -3,6 +3,6 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use WebDevEtc\BlogEtc\Services\CommentsService; |
5 | 5 | |
6 | -return function (/* @scrutinizer ignore-unused */ ?Model $user) { |
|
6 | +return function(/* @scrutinizer ignore-unused */ ?Model $user) { |
|
7 | 7 | return CommentsService::COMMENT_TYPE_BUILT_IN === config('blogetc.comments.type_of_comments_to_show'); |
8 | 8 | }; |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $categoryCount = \WebDevEtc\BlogEtc\Models\Post::count(); |
13 | 13 | |
14 | - echo $categoryCount . ' ' . str_plural('Post', $categoryCount); |
|
14 | + echo $categoryCount.' '.str_plural('Post', $categoryCount); |
|
15 | 15 | |
16 | 16 | ?>)</span> |
17 | 17 | </h6> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use WebDevEtc\BlogEtc\Exceptions\BlogEtcAuthGateNotImplementedException; |
5 | 5 | |
6 | -return function (/** @scrutinizer ignore-unused */ ?Model $user) { |
|
6 | +return function(/** @scrutinizer ignore-unused */ ?Model $user) { |
|
7 | 7 | // Do not copy the internals for this gate, as it provides backwards compatibility. |
8 | 8 | if (!$user) { |
9 | 9 | return false; |