@@ -32,21 +32,21 @@ discard block |
||
| 32 | 32 | * |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 35 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * The attributes that are mass assignable. |
| 39 | 39 | * |
| 40 | 40 | * @var array |
| 41 | 41 | */ |
| 42 | - protected $fillable = ['name', 'description', 'class']; |
|
| 42 | + protected $fillable = [ 'name', 'description', 'class' ]; |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * Columns to exclude from index |
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $excludedFromIndex = []; |
|
| 49 | + protected $excludedFromIndex = [ ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Fields to search in fulltext mode |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return object |
| 88 | 88 | */ |
| 89 | - public function pages(){ |
|
| 89 | + public function pages() { |
|
| 90 | 90 | |
| 91 | 91 | return $this->belongsToMany('App\Page', 'page_pagecategory', 'page_id', 'pagecategory_id'); |
| 92 | 92 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param query $query |
| 98 | 98 | * @return query |
| 99 | 99 | */ |
| 100 | - public function scopeRelationships($query){ |
|
| 100 | + public function scopeRelationships($query) { |
|
| 101 | 101 | |
| 102 | 102 | return $query->with('pages'); |
| 103 | 103 | } |
@@ -33,21 +33,21 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 36 | + protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * The attributes that are mass assignable. |
| 40 | 40 | * |
| 41 | 41 | * @var array |
| 42 | 42 | */ |
| 43 | - protected $fillable = ['name', 'description', 'position', 'image_id']; |
|
| 43 | + protected $fillable = [ 'name', 'description', 'position', 'image_id' ]; |
|
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Columns to exclude from index |
| 47 | 47 | * |
| 48 | 48 | * @var array |
| 49 | 49 | */ |
| 50 | - protected $excludedFromIndex = ['image']; |
|
| 50 | + protected $excludedFromIndex = [ 'image' ]; |
|
| 51 | 51 | |
| 52 | 52 | /** |
| 53 | 53 | * Fields to search in fulltext mode |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return object |
| 85 | 85 | */ |
| 86 | - public function images(){ |
|
| 86 | + public function images() { |
|
| 87 | 87 | |
| 88 | 88 | return $this->belongsTo('App\Image', 'image_id')->select('id', 'name', 'description', |
| 89 | 89 | 'alt', 'url', 'imagecategory_id', 'image_mime_type', 'image_extension', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | * @param query $query |
| 98 | 98 | * @return query |
| 99 | 99 | */ |
| 100 | - public function scopeRelationships($query){ |
|
| 100 | + public function scopeRelationships($query) { |
|
| 101 | 101 | |
| 102 | 102 | return $query->with('images', 'images.imagecategories'); |
| 103 | 103 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param query $query |
| 36 | 36 | * @return query |
| 37 | 37 | */ |
| 38 | - public function scopeFulltextAllColumns($query){ |
|
| 38 | + public function scopeFulltextAllColumns($query) { |
|
| 39 | 39 | |
| 40 | 40 | return Helpers::virtualFulltextSearchColumns($query, request('search'), $this->fulltextFields); |
| 41 | 41 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | * @param query $query |
| 47 | 47 | * @return query |
| 48 | 48 | */ |
| 49 | - public function scopeOrderByColumns($query){ |
|
| 49 | + public function scopeOrderByColumns($query) { |
|
| 50 | 50 | |
| 51 | 51 | return Helpers::orderByColumns($query, $this->defaultOrderBy); |
| 52 | 52 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | public function scopeExcludeFromIndex($query) |
| 61 | 61 | { |
| 62 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex) ); |
|
| 62 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex)); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -70,10 +70,10 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function scopeExcludeFromFind($query) |
| 72 | 72 | { |
| 73 | - if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
|
| 74 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
|
| 73 | + if (isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE) { |
|
| 74 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind)); |
|
| 75 | 75 | } |
| 76 | - else{ |
|
| 76 | + else { |
|
| 77 | 77 | return $query; |
| 78 | 78 | } |
| 79 | 79 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * @param type $query |
| 85 | 85 | * @return query |
| 86 | 86 | */ |
| 87 | - public function scopeRelationships($query){ |
|
| 87 | + public function scopeRelationships($query) { |
|
| 88 | 88 | |
| 89 | 89 | return $query; |
| 90 | 90 | } |
@@ -95,30 +95,30 @@ discard block |
||
| 95 | 95 | * @param query $query |
| 96 | 96 | * @return query |
| 97 | 97 | */ |
| 98 | - public function scopeExternalTablesFilter($query){ |
|
| 98 | + public function scopeExternalTablesFilter($query) { |
|
| 99 | 99 | |
| 100 | - if(Request::input('relation')){ |
|
| 100 | + if (Request::input('relation')) { |
|
| 101 | 101 | |
| 102 | - $allTables = []; |
|
| 102 | + $allTables = [ ]; |
|
| 103 | 103 | |
| 104 | 104 | $relations = explode(',', Request::input('relation')); |
| 105 | 105 | |
| 106 | - foreach ($relations as $relation){ |
|
| 106 | + foreach ($relations as $relation) { |
|
| 107 | 107 | |
| 108 | 108 | $keyvalue = explode(':', $relation); |
| 109 | 109 | |
| 110 | - $key = trim($keyvalue[0]); |
|
| 111 | - $value = trim($keyvalue[1]); |
|
| 110 | + $key = trim($keyvalue[ 0 ]); |
|
| 111 | + $value = trim($keyvalue[ 1 ]); |
|
| 112 | 112 | |
| 113 | - $allTables[$key] = $value; |
|
| 113 | + $allTables[ $key ] = $value; |
|
| 114 | 114 | |
| 115 | - if(is_numeric($value) == TRUE){ |
|
| 115 | + if (is_numeric($value) == TRUE) { |
|
| 116 | 116 | |
| 117 | - $query->where(strtolower($key)."_id", '=', $value); |
|
| 117 | + $query->where(strtolower($key) . "_id", '=', $value); |
|
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - request()->merge(['external_tables_filter' => $allTables]); |
|
| 121 | + request()->merge([ 'external_tables_filter' => $allTables ]); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | return $query; |
@@ -72,8 +72,7 @@ |
||
| 72 | 72 | { |
| 73 | 73 | if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
| 74 | 74 | return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
| 75 | - } |
|
| 76 | - else{ |
|
| 75 | + } else{ |
|
| 77 | 76 | return $query; |
| 78 | 77 | } |
| 79 | 78 | } |