@@ -44,18 +44,18 @@ |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | // Accessors |
| 47 | - public function getImageAttribute() |
|
| 48 | - { |
|
| 49 | - return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - public function getIconImageAttribute() |
|
| 53 | - { |
|
| 54 | - return ! is_null($this->getFirstMedia('icon_image')) ? $this->getFirstMediaUrl('icon_image') : asset('adminetic/static/placeholder.jpg'); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - public function scopeActive($qry) |
|
| 58 | - { |
|
| 59 | - return $qry->where('active', 1); |
|
| 60 | - } |
|
| 47 | + public function getImageAttribute() |
|
| 48 | + { |
|
| 49 | + return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + public function getIconImageAttribute() |
|
| 53 | + { |
|
| 54 | + return ! is_null($this->getFirstMedia('icon_image')) ? $this->getFirstMediaUrl('icon_image') : asset('adminetic/static/placeholder.jpg'); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + public function scopeActive($qry) |
|
| 58 | + { |
|
| 59 | + return $qry->where('active', 1); |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | parent::boot(); |
| 22 | 22 | |
| 23 | - static::saving(function () { |
|
| 23 | + static::saving(function() { |
|
| 24 | 24 | self::cacheKey(); |
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | - static::deleting(function () { |
|
| 27 | + static::deleting(function() { |
|
| 28 | 28 | self::cacheKey(); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | // Accessors |
| 47 | 47 | public function getImageAttribute() |
| 48 | 48 | { |
| 49 | - return ! is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
| 49 | + return !is_null($this->getFirstMedia('image')) ? $this->getFirstMediaUrl('image') : asset('adminetic/static/placeholder.jpg'); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function getIconImageAttribute() |
| 53 | 53 | { |
| 54 | - return ! is_null($this->getFirstMedia('icon_image')) ? $this->getFirstMediaUrl('icon_image') : asset('adminetic/static/placeholder.jpg'); |
|
| 54 | + return !is_null($this->getFirstMedia('icon_image')) ? $this->getFirstMediaUrl('icon_image') : asset('adminetic/static/placeholder.jpg'); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public function scopeActive($qry) |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | parent::boot(); |
| 22 | 22 | |
| 23 | - static::saving(function () { |
|
| 23 | + static::saving(function() { |
|
| 24 | 24 | self::cacheKey(); |
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | - static::deleting(function () { |
|
| 27 | + static::deleting(function() { |
|
| 28 | 28 | self::cacheKey(); |
| 29 | 29 | }); |
| 30 | 30 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | |
| 72 | 72 | public function products() |
| 73 | 73 | { |
| 74 | - return $this->hasMany(Product::class,'category_id'); |
|
| 74 | + return $this->hasMany(Product::class, 'category_id'); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // Scopes |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | 'type' => 'breaker', |
| 87 | 87 | 'name' => 'Website', |
| 88 | 88 | 'description' => 'CMS', |
| 89 | - ],[ |
|
| 89 | + ], [ |
|
| 90 | 90 | 'type' => 'menu', |
| 91 | 91 | 'name' => 'About', |
| 92 | 92 | 'icon' => 'fa fa-wrench', |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | ], |
| 104 | 104 | "children" => $this->indexCreateChildren("about", \App\Models\Admin\About::class), |
| 105 | 105 | |
| 106 | - ],[ |
|
| 106 | + ], [ |
|
| 107 | 107 | 'type' => 'menu', |
| 108 | 108 | 'name' => 'History', |
| 109 | 109 | 'icon' => 'fa fa-wrench', |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function indexHistory() |
| 14 | 14 | { |
| 15 | 15 | $histories = config('adminetic.caching', true) |
| 16 | - ? (Cache::has('histories') ? Cache::get('histories') : Cache::rememberForever('histories', function () { |
|
| 16 | + ? (Cache::has('histories') ? Cache::get('histories') : Cache::rememberForever('histories', function() { |
|
| 17 | 17 | return History::latest()->get(); |
| 18 | 18 | })) |
| 19 | 19 | : History::latest()->get(); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | public function indexAbout() |
| 14 | 14 | { |
| 15 | 15 | $abouts = config('adminetic.caching', true) |
| 16 | - ? (Cache::has('abouts') ? Cache::get('abouts') : Cache::rememberForever('abouts', function () { |
|
| 16 | + ? (Cache::has('abouts') ? Cache::get('abouts') : Cache::rememberForever('abouts', function() { |
|
| 17 | 17 | return About::latest()->get(); |
| 18 | 18 | })) |
| 19 | 19 | : About::latest()->get(); |