@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | private function dropSeries() |
| 55 | 55 | { |
| 56 | - Schema::table('rainlab_blog_posts', function ($table) { |
|
| 57 | - $table->dropForeign([Series::TABLE_NAME . '_id']); |
|
| 56 | + Schema::table('rainlab_blog_posts', function($table) { |
|
| 57 | + $table->dropForeign([ Series::TABLE_NAME . '_id' ]); |
|
| 58 | 58 | $table->dropColumn(Series::TABLE_NAME . '_id'); |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | { |
| 69 | 69 | Schema::create( |
| 70 | 70 | Tag::TABLE_NAME, |
| 71 | - function ($table) { |
|
| 71 | + function($table) { |
|
| 72 | 72 | $table->engine = 'InnoDB'; |
| 73 | 73 | |
| 74 | 74 | $table->increments('id'); |
@@ -80,12 +80,12 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | Schema::create( |
| 82 | 82 | Tag::CROSS_REFERENCE_TABLE_NAME, |
| 83 | - function ($table) { |
|
| 83 | + function($table) { |
|
| 84 | 84 | $table->engine = 'InnoDB'; |
| 85 | 85 | |
| 86 | 86 | $table->integer('tag_id')->unsigned()->nullable()->default(null); |
| 87 | 87 | $table->integer('post_id')->unsigned()->nullable()->default(null); |
| 88 | - $table->index(['tag_id', 'post_id']); |
|
| 88 | + $table->index([ 'tag_id', 'post_id' ]); |
|
| 89 | 89 | $table->foreign('tag_id', 'Tag reference')->references('id')->on(Tag::TABLE_NAME)->onDelete('cascade'); |
| 90 | 90 | $table->foreign('post_id', 'Post reference')->references('id')->on('rainlab_blog_posts')->onDelete('cascade'); |
| 91 | 91 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | { |
| 100 | 100 | Schema::create( |
| 101 | 101 | Series::TABLE_NAME, |
| 102 | - function ($table) { |
|
| 102 | + function($table) { |
|
| 103 | 103 | $table->engine = 'InnoDB'; |
| 104 | 104 | |
| 105 | 105 | $table->increments('id'); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | } |
| 111 | 111 | ); |
| 112 | 112 | |
| 113 | - Schema::table('rainlab_blog_posts', function ($table) { |
|
| 113 | + Schema::table('rainlab_blog_posts', function($table) { |
|
| 114 | 114 | $table->integer(Series::TABLE_NAME . '_id')->unsigned()->nullable()->default(null); |
| 115 | 115 | $table->foreign(Series::TABLE_NAME . '_id')->references('id')->on(Series::TABLE_NAME)->onDelete('cascade'); |
| 116 | 116 | }); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function onBulkDelete() |
| 56 | 56 | { |
| 57 | - if (($checkedIds = (array)post('checked', []))) { |
|
| 57 | + if (($checkedIds = (array)post('checked', [ ]))) { |
|
| 58 | 58 | $delete = Tag::whereIn('id', $checkedIds)->delete(); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $this->asExtension('FormController')->update(post('record_id')); |
| 119 | 119 | |
| 120 | - $this->vars['recordId'] = post('record_id'); |
|
| 120 | + $this->vars[ 'recordId' ] = post('record_id'); |
|
| 121 | 121 | |
| 122 | 122 | return $this->makePartial('tag_update_modal_form'); |
| 123 | 123 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * @var array |
| 33 | 33 | */ |
| 34 | - protected $slugs = ['slug' => 'name']; |
|
| 34 | + protected $slugs = [ 'slug' => 'name' ]; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * Relations |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | /** |
| 84 | 84 | * @var array |
| 85 | 85 | */ |
| 86 | - protected $slugs = ['slug' => 'title']; |
|
| 86 | + protected $slugs = [ 'slug' => 'title' ]; |
|
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * @return mixed |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | */ |
| 65 | 65 | protected function getPostsQuery() |
| 66 | 66 | { |
| 67 | - $query = Post::whereHas('tags', function ($query) { |
|
| 67 | + $query = Post::whereHas('tags', function($query) { |
|
| 68 | 68 | $query->where('slug', $this->tag->slug); |
| 69 | 69 | })->isPublished(); |
| 70 | 70 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | */ |
| 63 | 63 | protected function getPostsQuery() |
| 64 | 64 | { |
| 65 | - $query = Post::whereHas('series', function ($query) { |
|
| 65 | + $query = Post::whereHas('series', function($query) { |
|
| 66 | 66 | $query->where('slug', $this->series->slug); |
| 67 | 67 | })->isPublished(); |
| 68 | 68 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | /** |
| 22 | 22 | * @var Collection | array |
| 23 | 23 | */ |
| 24 | - public $tags = []; |
|
| 24 | + public $tags = [ ]; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * Reference to the page name for linking to tags page |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->orderBy = $this->getProperty('orderBy'); |
| 151 | 151 | $this->postSlug = $this->property('postSlug'); |
| 152 | 152 | $this->displayEmpty = $this->getProperty('displayEmpty'); |
| 153 | - $this->limit = $this->getProperty('limit'); |
|
| 153 | + $this->limit = $this->getProperty('limit'); |
|
| 154 | 154 | |
| 155 | 155 | $this->tags = $this->listTags(); |
| 156 | 156 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $tagComponent = $this->getComponent(TagPosts::NAME, $this->tagsPage); |
| 171 | 171 | |
| 172 | - $this->setUrls($tags, $this->tagsPage, $this->controller, ['tag' => $this->urlProperty($tagComponent, 'tag')]); |
|
| 172 | + $this->setUrls($tags, $this->tagsPage, $this->controller, [ 'tag' => $this->urlProperty($tagComponent, 'tag') ]); |
|
| 173 | 173 | |
| 174 | 174 | return $tags; |
| 175 | 175 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | 76 | if (!empty($this->categoryPage) && $post->categories->count()) { |
| 77 | - $post->categories->each(function ($category) use ($blogCategoriesComponent) { |
|
| 77 | + $post->categories->each(function($category) use ($blogCategoriesComponent) { |
|
| 78 | 78 | /** @var Category $category */ |
| 79 | 79 | $category->setUrl( |
| 80 | 80 | $this->categoryPage, |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | */ |
| 114 | 114 | public function getProperty(string $property, $default = null) |
| 115 | 115 | { |
| 116 | - return $this->property($property, $this->defineProperties()[$property]['default'] ?? $default); |
|
| 116 | + return $this->property($property, $this->defineProperties()[ $property ][ 'default' ] ?? $default); |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $component = $page->getComponent($componentName); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if (!empty($component) && is_callable([$this->controller, 'setComponentPropertiesFromParams'])) { |
|
| 134 | + if (!empty($component) && is_callable([ $this->controller, 'setComponentPropertiesFromParams' ])) { |
|
| 135 | 135 | $this->controller->setComponentPropertiesFromParams($component); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * @var Collection | array |
| 25 | 25 | */ |
| 26 | - public $posts = []; |
|
| 26 | + public $posts = [ ]; |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Reference to the page name for linking to posts |
@@ -126,10 +126,10 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | private function prepareVars() |
| 128 | 128 | { |
| 129 | - $this->orderBy = $this->page['orderBy'] = $this->property('orderBy'); |
|
| 129 | + $this->orderBy = $this->page[ 'orderBy' ] = $this->property('orderBy'); |
|
| 130 | 130 | |
| 131 | 131 | // Page links |
| 132 | - $this->postPage = $this->page['postPage' ] = $this->property('postPage'); |
|
| 132 | + $this->postPage = $this->page[ 'postPage' ] = $this->property('postPage'); |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | public function getPostPageOptions() |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | |
| 165 | 165 | $query = Post::isPublished() |
| 166 | 166 | ->where('id', '<>', $post->id) |
| 167 | - ->whereHas('tags', function ($tag) use ($tagIds) { |
|
| 167 | + ->whereHas('tags', function($tag) use ($tagIds) { |
|
| 168 | 168 | $tag->whereIn('id', $tagIds); |
| 169 | 169 | }) |
| 170 | 170 | ->with('tags'); |