Completed
Push — master ( bfbb50...8023d3 )
by Sherif
09:55
created

Setting::getDeletedAtAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Modules\Core;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
use App\Modules\Core\ModelObservers\SettingsObserver;
8
9
class Setting extends Model
10
{
11
12
    use SoftDeletes;
13
    protected $table    = 'settings';
14
    protected $dates    = ['created_at', 'updated_at', 'deleted_at'];
15
    protected $hidden   = ['deleted_at'];
16
    protected $guarded  = ['id', 'key'];
17
    protected $fillable = ['name', 'value'];
18
    
19
    public function newCollection(array $models = [])
20
    {
21
        return parent::newCollection($models)->keyBy('key');
22
    }
23
24
    public static function boot()
25
    {
26
        parent::boot();
27
        Setting::observe(SettingsObserver::class);
28
    }
29
}
30