@@ -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'); |
@@ -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, |
@@ -45,7 +45,7 @@ |
||
45 | 45 | */ |
46 | 46 | public function search(SearchRequest $request): \Illuminate\Contracts\View\View |
47 | 47 | { |
48 | - $searchResults = collect((new Search())->run($request->searchQuery()))->filter(static function ($result) { |
|
48 | + $searchResults = collect((new Search())->run($request->searchQuery()))->filter(static function($result) { |
|
49 | 49 | return $result->indexable && is_a($result->indexable, Post::class) && $result->indexable->isPublic(); |
50 | 50 | }); |
51 | 51 |