for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace App\Modules\Core;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Setting extends Model
{
use SoftDeletes;
protected $table = 'settings';
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $hidden = ['deleted_at'];
protected $guarded = ['id', 'key'];
protected $fillable = ['name', 'value'];
public $searchable = ['name', 'value', 'key'];
public function getCreatedAtAttribute($value)
return \Carbon\Carbon::parse($value)->tz(\Session::get('time-zone'))->toDateTimeString();
}
public function getUpdatedAtAttribute($value)
public function getDeletedAtAttribute($value)
public function newCollection(array $models = [])
return parent::newCollection($models)->keyBy('key');
public static function boot()
parent::boot();
Setting::observe(\App::make('App\Modules\Core\ModelObservers\SettingsObserver'));