@@ -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,6 +3,6 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use WebDevEtc\BlogEtc\Services\CommentsService; |
5 | 5 | |
6 | -return static function (/* @scrutinizer ignore-unused */ ?Model $user) { |
|
6 | +return static function(/* @scrutinizer ignore-unused */ ?Model $user) { |
|
7 | 7 | return CommentsService::COMMENT_TYPE_BUILT_IN === config('blogetc.comments.type_of_comments_to_show'); |
8 | 8 | }; |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | // However it will NOT delete the .jpg file on your file server. |
67 | 67 | // I recommend that you only change the enabled field before any images have been uploaded! |
68 | 68 | |
69 | - 'image_large' => [ // this key must start with 'image_'. This is what the DB column must be named |
|
69 | + 'image_large' => [// this key must start with 'image_'. This is what the DB column must be named |
|
70 | 70 | // width in pixels |
71 | 71 | 'w' => 1000, |
72 | 72 | //height |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | // if true then we will crop and resize to exactly w/h. If false then it will maintain proportions, with a max width of 'w' and max height of 'h' |
81 | 81 | 'crop' => true, |
82 | 82 | ], |
83 | - 'image_medium' => [ // this key must start with 'image_'. This is what the DB column must be named |
|
83 | + 'image_medium' => [// this key must start with 'image_'. This is what the DB column must be named |
|
84 | 84 | // width in pixels |
85 | 85 | 'w' => 600, |
86 | 86 | //height |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | // if true then we will crop and resize to exactly w/h. If false then it will maintain proportions, with a max width of 'w' and max height of 'h'. If you use these images as part of your website template then you should probably have this to true. |
95 | 95 | 'crop' => true, |
96 | 96 | ], |
97 | - 'image_thumbnail' => [ // this key must start with 'image_'. This is what the DB column must be named |
|
97 | + 'image_thumbnail' => [// this key must start with 'image_'. This is what the DB column must be named |
|
98 | 98 | 'w' => 150, // width in pixels |
99 | 99 | 'h' => 150, //height |
100 | 100 | 'basic_key' => 'thumbnail', // same as the main key, but WITHOUT 'image_'. |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | 'rssfeed' => [ |
141 | 141 | 'should_shorten_text' => true, // boolean. Default: true. Should we shorten the text in rss feed? |
142 | 142 | 'text_limit' => 100, // max length of description text in the rss feed |
143 | - 'posts_to_show_in_rss_feed' => 10, // how many posts should we show in the rss feed |
|
143 | + 'posts_to_show_in_rss_feed' => 10, // how many posts should we show in the rss feed |
|
144 | 144 | 'cache_in_minutes' => 60, // how long (in minutes) to cache the RSS blog feed for. |
145 | 145 | 'description' => 'Our blog post RSS feed', //description for the RSS feed |
146 | 146 | 'language' => 'en', // see https://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes |
@@ -24,14 +24,14 @@ |
||
24 | 24 | // } |
25 | 25 | // }; |
26 | 26 | |
27 | - $show_error_if_has_value = static function ($attribute, $value, $fail) { |
|
27 | + $show_error_if_has_value = static function($attribute, $value, $fail) { |
|
28 | 28 | if ($value) { |
29 | 29 | // return $fail if this had a value... |
30 | 30 | return $fail($attribute.' must be empty'); |
31 | 31 | } |
32 | 32 | }; |
33 | 33 | |
34 | - $disabled_use_view_file = static function ($attribute, $value, $fail) { |
|
34 | + $disabled_use_view_file = static function($attribute, $value, $fail) { |
|
35 | 35 | if ($value) { |
36 | 36 | // return $fail if this had a value |
37 | 37 | return $fail('The use of custom view files is not enabled for this site, so you cannot submit a value for it'); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $smallest = null; |
36 | 36 | $smallest_size = -1; |
37 | 37 | foreach ($uploadedPhoto->uploaded_images as $file_key => $file) { |
38 | - $id = 'uploaded_' . ($uploadedPhoto->id) . '_' . $file_key; ?> |
|
38 | + $id = 'uploaded_'.($uploadedPhoto->id).'_'.$file_key; ?> |
|
39 | 39 | |
40 | 40 | <div class="col-md-12"> |
41 | 41 | <h6 class="text-center mt-3"> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | use Illuminate\Database\Eloquent\Model; |
4 | 4 | use WebDevEtc\BlogEtc\Exceptions\BlogEtcAuthGateNotImplementedException; |
5 | 5 | |
6 | -return static function (/** @scrutinizer ignore-unused */ ?Model $user) { |
|
6 | +return static 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; |
@@ -9,9 +9,9 @@ |
||
9 | 9 | use WebDevEtc\BlogEtc\Models\Comment; |
10 | 10 | use WebDevEtc\BlogEtc\Models\Post; |
11 | 11 | |
12 | -$factory->define(Comment::class, static function (Faker $faker) { |
|
12 | +$factory->define(Comment::class, static function(Faker $faker) { |
|
13 | 13 | return [ |
14 | - 'blog_etc_post_id' => static function () { |
|
14 | + 'blog_etc_post_id' => static function() { |
|
15 | 15 | return factory(Post::class)->create()->id; |
16 | 16 | }, |
17 | 17 | 'user_id' => null, |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | if (isset($image_size_details['crop']) && $image_size_details['crop']) { |
201 | 201 | $resizedImage = $resizedImage->fit($w, $h); |
202 | 202 | } else { |
203 | - $resizedImage = $resizedImage->resize($w, $h, static function ($constraint) { |
|
203 | + $resizedImage = $resizedImage->resize($w, $h, static function($constraint) { |
|
204 | 204 | $constraint->aspectRatio(); |
205 | 205 | }); |
206 | 206 | } |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | if (isset($imageSizeDetails['crop']) && $imageSizeDetails['crop']) { |
411 | 411 | $resizedImage = $resizedImage->fit($w, $h); |
412 | 412 | } else { |
413 | - $resizedImage = $resizedImage->resize($w, $h, static function (Constraint $constraint) { |
|
413 | + $resizedImage = $resizedImage->resize($w, $h, static function(Constraint $constraint) { |
|
414 | 414 | $constraint->aspectRatio(); |
415 | 415 | }); |
416 | 416 | } |
@@ -1,21 +1,21 @@ 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 | Route::get('/search', 'PostsController@search')->name('blogetc.search'); |
8 | 8 | Route::get('/feed', 'BlogEtcRssFeedController@feed')->name('blogetc.feed'); |
9 | 9 | Route::get('/category/{categorySlug}', 'PostsController@showCategory')->name('blogetc.view_category'); |
10 | 10 | Route::get('/{blogPostSlug}', 'PostsController@show')->name('blogetc.single'); |
11 | 11 | |
12 | - Route::group(['middleware' => 'throttle:10,3'], static function () { |
|
12 | + Route::group(['middleware' => 'throttle:10,3'], static function() { |
|
13 | 13 | Route::post('save_comment/{blogPostSlug}', 'CommentsController@store')->name('blogetc.comments.add_new_comment'); |
14 | 14 | }); |
15 | 15 | }); |
16 | 16 | |
17 | 17 | /* Admin backend routes - CRUD for posts, categories, and approving/deleting submitted comments */ |
18 | - Route::group(['prefix' => config('blogetc.admin_prefix', 'blog_admin')], static function () { |
|
18 | + Route::group(['prefix' => config('blogetc.admin_prefix', 'blog_admin')], static function() { |
|
19 | 19 | Route::get('/', 'Admin\ManagePostsController@index')->name('blogetc.admin.index'); |
20 | 20 | |
21 | 21 | Route::get('/add_post', 'Admin\ManagePostsController@create')->name('blogetc.admin.create_post'); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | Route::get('/edit_post/{blogPostId}', 'Admin\ManagePostsController@edit')->name('blogetc.admin.edit_post'); |
25 | 25 | Route::patch('/edit_post/{blogPostId}', 'Admin\ManagePostsController@update')->name('blogetc.admin.update_post'); |
26 | 26 | |
27 | - Route::group(['prefix' => 'image_uploads'], static function () { |
|
27 | + Route::group(['prefix' => 'image_uploads'], static function() { |
|
28 | 28 | Route::get('/', 'Admin\ManageUploadsController@index')->name('blogetc.admin.images.all'); |
29 | 29 | |
30 | 30 | Route::get('/upload', 'Admin\ManageUploadsController@create')->name('blogetc.admin.images.upload'); |
@@ -36,14 +36,14 @@ discard block |
||
36 | 36 | |
37 | 37 | Route::delete('/delete_post/{blogPostId}', 'Admin\ManagePostsController@destroy')->name('blogetc.admin.destroy_post'); |
38 | 38 | |
39 | - Route::group(['prefix' => 'comments'], static function () { |
|
39 | + Route::group(['prefix' => 'comments'], static function() { |
|
40 | 40 | Route::get('/', 'Admin\ManageCommentsController@index')->name('blogetc.admin.comments.index'); |
41 | 41 | Route::patch('/{commentId}', 'Admin\ManageCommentsController@approve')->name('blogetc.admin.comments.approve'); |
42 | 42 | |
43 | 43 | Route::delete('/{commentId}', 'Admin\ManageCommentsController@destroy')->name('blogetc.admin.comments.delete'); |
44 | 44 | }); |
45 | 45 | |
46 | - Route::group(['prefix' => 'categories'], static function () { |
|
46 | + Route::group(['prefix' => 'categories'], static function() { |
|
47 | 47 | Route::get('/', 'Admin\ManageCategoriesController@index')->name('blogetc.admin.categories.index'); |
48 | 48 | |
49 | 49 | Route::get('/add_category', 'Admin\ManageCategoriesController@create')->name('blogetc.admin.categories.create_category'); |