| @@ 6-35 (lines=30) @@ | ||
| 3 | use Illuminate\Database\Eloquent\Model; |
|
| 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
|
| 5 | ||
| 6 | class Settings extends Model{ |
|
| 7 | ||
| 8 | use SoftDeletes; |
|
| 9 | protected $table = 'settings'; |
|
| 10 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | protected $hidden = ['deleted_at']; |
|
| 12 | protected $guarded = ['id', 'key']; |
|
| 13 | protected $fillable = ['name','value']; |
|
| 14 | ||
| 15 | public function getCreatedAtAttribute($value) |
|
| 16 | { |
|
| 17 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getUpdatedAtAttribute($value) |
|
| 21 | { |
|
| 22 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getDeletedAtAttribute($value) |
|
| 26 | { |
|
| 27 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 28 | } |
|
| 29 | ||
| 30 | public static function boot() |
|
| 31 | { |
|
| 32 | parent::boot(); |
|
| 33 | parent::observe(\App::make('App\Modules\V1\Core\ModelObservers\SettingsObserver')); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 6-35 (lines=30) @@ | ||
| 3 | use Illuminate\Database\Eloquent\Model; |
|
| 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
|
| 5 | ||
| 6 | class Report extends Model{ |
|
| 7 | ||
| 8 | use SoftDeletes; |
|
| 9 | protected $table = 'reports'; |
|
| 10 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | protected $hidden = ['deleted_at']; |
|
| 12 | protected $guarded = ['id']; |
|
| 13 | protected $fillable = ['report_name', 'view_name']; |
|
| 14 | ||
| 15 | public function getCreatedAtAttribute($value) |
|
| 16 | { |
|
| 17 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getUpdatedAtAttribute($value) |
|
| 21 | { |
|
| 22 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getDeletedAtAttribute($value) |
|
| 26 | { |
|
| 27 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 28 | } |
|
| 29 | ||
| 30 | public static function boot() |
|
| 31 | { |
|
| 32 | parent::boot(); |
|
| 33 | parent::observe(\App::make('App\Modules\V1\Reporting\ModelObservers\ReprotObserver')); |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| @@ 6-40 (lines=35) @@ | ||
| 3 | use Illuminate\Database\Eloquent\Model; |
|
| 4 | use Illuminate\Database\Eloquent\SoftDeletes; |
|
| 5 | ||
| 6 | class PushNotificationDevice extends Model{ |
|
| 7 | ||
| 8 | use SoftDeletes; |
|
| 9 | protected $table = 'push_notifications_devices'; |
|
| 10 | protected $dates = ['created_at', 'updated_at', 'deleted_at']; |
|
| 11 | protected $hidden = ['deleted_at']; |
|
| 12 | protected $guarded = ['id']; |
|
| 13 | protected $fillable = ['device_token', 'device_type', 'user_id', 'active']; |
|
| 14 | ||
| 15 | public function getCreatedAtAttribute($value) |
|
| 16 | { |
|
| 17 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function getUpdatedAtAttribute($value) |
|
| 21 | { |
|
| 22 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function getDeletedAtAttribute($value) |
|
| 26 | { |
|
| 27 | return \Carbon\Carbon::parse($value)->addHours(\Session::get('timeZoneDiff'))->toDateTimeString(); |
|
| 28 | } |
|
| 29 | ||
| 30 | public function user() |
|
| 31 | { |
|
| 32 | return $this->belongsTo('App\Modules\V1\Acl\AclUser'); |
|
| 33 | } |
|
| 34 | ||
| 35 | public static function boot() |
|
| 36 | { |
|
| 37 | parent::boot(); |
|
| 38 | parent::observe(\App::make('App\Modules\V1\Notifications\ModelObservers\PushNotificationDeviceObserver')); |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||