@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public function boot() |
| 16 | 16 | { |
| 17 | 17 | // |
| 18 | - require_once app_path().'/Http/Helpers.php'; |
|
| 18 | + require_once app_path() . '/Http/Helpers.php'; |
|
| 19 | 19 | Paginator::useBootstrap(); |
| 20 | 20 | } |
| 21 | 21 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return \Illuminate\Database\Eloquent\Builder |
| 37 | 37 | */ |
| 38 | - public function scopeFulltextAllColumns(Builder $query){ |
|
| 38 | + public function scopeFulltextAllColumns(Builder $query) { |
|
| 39 | 39 | |
| 40 | 40 | return Helpers::virtualFulltextSearchColumns($query, request('search'), $this->fulltextFields); |
| 41 | 41 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @return \Illuminate\Database\Eloquent\Builder |
| 47 | 47 | */ |
| 48 | - public function scopeOrderByColumns(Builder $query){ |
|
| 48 | + public function scopeOrderByColumns(Builder $query) { |
|
| 49 | 49 | |
| 50 | 50 | return Helpers::orderByColumns($query, $this->defaultOrderBy); |
| 51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function scopeExcludeFromIndex(Builder $query) |
| 59 | 59 | { |
| 60 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex) ); |
|
| 60 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromIndex)); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -67,10 +67,10 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public function scopeExcludeFromFind(Builder $query) |
| 69 | 69 | { |
| 70 | - if(isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE){ |
|
| 71 | - return $query->select( array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind) ); |
|
| 70 | + if (isset($this->excludedFromFind) == TRUE && is_array($this->excludedFromFind) == TRUE) { |
|
| 71 | + return $query->select(array_diff(Schema::getColumnListing($this->table), $this->excludedFromFind)); |
|
| 72 | 72 | } |
| 73 | - else{ |
|
| 73 | + else { |
|
| 74 | 74 | return $query; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | * |
| 81 | 81 | * @return \Illuminate\Database\Eloquent\Builder |
| 82 | 82 | */ |
| 83 | - public function scopeRelationships(Builder $query){ |
|
| 83 | + public function scopeRelationships(Builder $query) { |
|
| 84 | 84 | |
| 85 | 85 | return $query; |
| 86 | 86 | } |
@@ -90,24 +90,24 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return \Illuminate\Database\Eloquent\Builder |
| 92 | 92 | */ |
| 93 | - public function scopeExternalTablesFilter(Builder $query){ |
|
| 93 | + public function scopeExternalTablesFilter(Builder $query) { |
|
| 94 | 94 | |
| 95 | - if(Request::input('relation')){ |
|
| 95 | + if (Request::input('relation')) { |
|
| 96 | 96 | |
| 97 | - $allTables = []; |
|
| 97 | + $allTables = [ ]; |
|
| 98 | 98 | |
| 99 | 99 | $relations = explode(',', Request::input('relation')); |
| 100 | 100 | |
| 101 | - foreach ($relations as $relation){ |
|
| 101 | + foreach ($relations as $relation) { |
|
| 102 | 102 | |
| 103 | 103 | $keyvalue = explode(':', $relation); |
| 104 | 104 | |
| 105 | - if(count($keyvalue) > 1) { |
|
| 105 | + if (count($keyvalue) > 1) { |
|
| 106 | 106 | |
| 107 | - $key = trim($keyvalue[0]); |
|
| 108 | - $value = trim($keyvalue[1]); |
|
| 107 | + $key = trim($keyvalue[ 0 ]); |
|
| 108 | + $value = trim($keyvalue[ 1 ]); |
|
| 109 | 109 | |
| 110 | - $allTables[$key] = $value; |
|
| 110 | + $allTables[ $key ] = $value; |
|
| 111 | 111 | |
| 112 | 112 | if (is_numeric($value) == TRUE) { |
| 113 | 113 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | - request()->merge(['external_tables_filter' => $allTables]); |
|
| 119 | + request()->merge([ 'external_tables_filter' => $allTables ]); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | return $query; |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | 'api' => [ |
| 42 | 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, |
| 43 | - \Illuminate\Routing\Middleware\ThrottleRequests::class.':api', |
|
| 43 | + \Illuminate\Routing\Middleware\ThrottleRequests::class . ':api', |
|
| 44 | 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, |
| 45 | 45 | ], |
| 46 | 46 | ]; |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $fillable = ['name', 'description', 'color']; |
|
| 49 | + protected $fillable = [ 'name', 'description', 'color' ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Columns to exclude from index |
| 53 | 53 | * |
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | - protected $excludedFromIndex = []; |
|
| 56 | + protected $excludedFromIndex = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Fields to search in fulltext mode |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return object |
| 90 | 90 | */ |
| 91 | - public function images(){ |
|
| 91 | + public function images() { |
|
| 92 | 92 | |
| 93 | 93 | return $this->hasMany('App\Image', 'imagecategory_id'); |
| 94 | 94 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param query $query@ |
| 100 | 100 | * @return query |
| 101 | 101 | */ |
| 102 | - public function scopeRelationships($query){ |
|
| 102 | + public function scopeRelationships($query) { |
|
| 103 | 103 | |
| 104 | 104 | return $query->with('images'); |
| 105 | 105 | } |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $fillable = ['name', 'description', 'color']; |
|
| 49 | + protected $fillable = [ 'name', 'description', 'color' ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Columns to exclude from index |
| 53 | 53 | * |
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | - protected $excludedFromIndex = []; |
|
| 56 | + protected $excludedFromIndex = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Fields to search in fulltext mode |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return object |
| 90 | 90 | */ |
| 91 | - public function adverts(){ |
|
| 91 | + public function adverts() { |
|
| 92 | 92 | |
| 93 | 93 | return $this->belongsToMany('App\Advert', 'advert_advertlocation', 'advert_id', 'advertlocation_id'); |
| 94 | 94 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @param type $query |
| 100 | 100 | * @return object |
| 101 | 101 | */ |
| 102 | - public function scopeRelationships($query){ |
|
| 102 | + public function scopeRelationships($query) { |
|
| 103 | 103 | |
| 104 | 104 | return $query->with('adverts'); |
| 105 | 105 | } |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | * |
| 47 | 47 | * @var array |
| 48 | 48 | */ |
| 49 | - protected $fillable = ['name', 'color']; |
|
| 49 | + protected $fillable = [ 'name', 'color' ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Columns to exclude from index |
| 53 | 53 | * |
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | - protected $excludedFromIndex = []; |
|
| 56 | + protected $excludedFromIndex = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Fields to search in fulltext mode |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * |
| 85 | 85 | * @return object |
| 86 | 86 | */ |
| 87 | - public function comments(){ |
|
| 87 | + public function comments() { |
|
| 88 | 88 | |
| 89 | 89 | return $this->hasMany('App\Comment', 'commentstatus_id'); |
| 90 | 90 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @param query $query |
| 96 | 96 | * @return query |
| 97 | 97 | */ |
| 98 | - public function scopeRelationships($query){ |
|
| 98 | + public function scopeRelationships($query) { |
|
| 99 | 99 | |
| 100 | 100 | return $query->with('comments'); |
| 101 | 101 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @var array |
| 46 | 46 | */ |
| 47 | - protected $fillable = ['name']; |
|
| 47 | + protected $fillable = [ 'name' ]; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Fields to search in fulltext mode |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * |
| 75 | 75 | * @return object |
| 76 | 76 | */ |
| 77 | - public function users(){ |
|
| 77 | + public function users() { |
|
| 78 | 78 | |
| 79 | 79 | return $this->hasMany('App\User', 'usergroup_id'); |
| 80 | 80 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @param query $query |
| 86 | 86 | * @return query |
| 87 | 87 | */ |
| 88 | - public function scopeRelationships($query){ |
|
| 88 | + public function scopeRelationships($query) { |
|
| 89 | 89 | |
| 90 | 90 | return $query->with('users'); |
| 91 | 91 | } |
@@ -45,15 +45,15 @@ discard block |
||
| 45 | 45 | * |
| 46 | 46 | * @var array |
| 47 | 47 | */ |
| 48 | - protected $fillable = ['name', 'author_name', 'meta_title', 'meta_description', |
|
| 49 | - 'meta_keywords', 'text', 'url', 'image_id', 'user_id', 'published_at']; |
|
| 48 | + protected $fillable = [ 'name', 'author_name', 'meta_title', 'meta_description', |
|
| 49 | + 'meta_keywords', 'text', 'url', 'image_id', 'user_id', 'published_at' ]; |
|
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * Columns to exclude from index |
| 53 | 53 | * |
| 54 | 54 | * @var array |
| 55 | 55 | */ |
| 56 | - protected $excludedFromIndex = []; |
|
| 56 | + protected $excludedFromIndex = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Fields to search in fulltext mode |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return object |
| 90 | 90 | */ |
| 91 | - public function images(){ |
|
| 91 | + public function images() { |
|
| 92 | 92 | |
| 93 | 93 | return $this->belongsTo('App\Image', 'image_id')->select('id', 'name', 'description', |
| 94 | 94 | 'alt', 'url', 'imagecategory_id', 'image_mime_type', 'image_extension', |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * |
| 102 | 102 | * @return object |
| 103 | 103 | */ |
| 104 | - public function pagecategories(){ |
|
| 104 | + public function pagecategories() { |
|
| 105 | 105 | |
| 106 | 106 | return $this->belongsToMany('App\PageCategory', 'page_pagecategory', 'page_id', 'pagecategory_id'); |
| 107 | 107 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * @return object |
| 113 | 113 | */ |
| 114 | - public function comments(){ |
|
| 114 | + public function comments() { |
|
| 115 | 115 | |
| 116 | 116 | return $this->hasMany('App\Comment', 'page_id'); |
| 117 | 117 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @return object |
| 123 | 123 | */ |
| 124 | - public function users(){ |
|
| 124 | + public function users() { |
|
| 125 | 125 | |
| 126 | 126 | return $this->belongsTo('App\User', 'user_id'); |
| 127 | 127 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * @param query $query |
| 133 | 133 | * @return query |
| 134 | 134 | */ |
| 135 | - public function scopeRelationships($query){ |
|
| 135 | + public function scopeRelationships($query) { |
|
| 136 | 136 | |
| 137 | 137 | return $query->with('images', 'images.imagecategories', 'pagecategories', 'users'); |
| 138 | 138 | } |
@@ -44,14 +44,14 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @var array |
| 46 | 46 | */ |
| 47 | - protected $fillable = ['name', 'description', 'cycle_interval']; |
|
| 47 | + protected $fillable = [ 'name', 'description', 'cycle_interval' ]; |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * Columns to exclude from index |
| 51 | 51 | * |
| 52 | 52 | * @var array |
| 53 | 53 | */ |
| 54 | - protected $excludedFromIndex = []; |
|
| 54 | + protected $excludedFromIndex = [ ]; |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Fields to search in fulltext mode |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * |
| 88 | 88 | * @return object |
| 89 | 89 | */ |
| 90 | - public function slides(){ |
|
| 90 | + public function slides() { |
|
| 91 | 91 | |
| 92 | 92 | return $this->hasMany('App\Slide', 'slider_id')->orderBy('position', 'asc'); |
| 93 | 93 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @param query $query |
| 99 | 99 | * @return query |
| 100 | 100 | */ |
| 101 | - public function scopeRelationships($query){ |
|
| 101 | + public function scopeRelationships($query) { |
|
| 102 | 102 | |
| 103 | 103 | return $query->with('slides', 'slides.images', 'slides.images', 'slides.images.imagecategories'); |
| 104 | 104 | } |