'int', 'shopping_user_id' => 'int', 'payone_userid' => 'int', 'amount' => 'int', 'active' => 'bool', 'status' => 'int', 'abo_interval' => 'int', 'start_date' => 'datetime', 'last_date' => 'datetime', 'next_date' => 'datetime', 'cancel_date' => 'datetime', 'count' => 'int', 'user_deleted_at' => 'datetime' ]; protected $fillable = [ 'user_id', 'shopping_user_id', 'is_for', 'payone_userid', 'clearingtype', 'wallettype', 'amount', 'currency', 'active', 'status', 'abo_interval', 'start_date', 'last_date', 'next_date', 'cancel_date', 'count', 'user_deleted_at' ]; public function user() { return $this->belongsTo(User::class); } public function shopping_user() { return $this->belongsTo('App\Models\ShoppingUser','shopping_user_id'); } public function user_abo_orders() { return $this->hasMany(UserAboOrder::class); } public function setStartDateAttribute( $value ) { $this->attributes['start_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL; } public function getStartDateAttribute() { return $this->attributes['start_date'] ? Carbon::parse($this->attributes['start_date'])->format(\Util::formatDateDB()) : ''; } public function setLastDateAttribute( $value ) { $this->attributes['last_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL; } public function getLastDateAttribute() { return $this->attributes['last_date'] ? Carbon::parse($this->attributes['last_date'])->format(\Util::formatDateDB()) : ''; } public function setNextDateAttribute( $value ) { $this->attributes['next_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL; } public function getNextDateAttribute() { return $this->attributes['next_date'] ? Carbon::parse($this->attributes['next_date'])->format(\Util::formatDateDB()) : ''; } public function setCancelDateAttribute( $value ) { $this->attributes['cancel_date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL; } public function getCancelDateAttribute() { return $this->attributes['cancel_date'] ? Carbon::parse($this->attributes['cancel_date'])->format(\Util::formatDateDB()) : ''; } }