'Provision Shop', 2 => 'Provision Payline', 3 => 'Guthaben hinzugefügt', 4 => 'commission ...', 5 => 'Provision Wachstumsbonus', ]; public static $statusColors = [ 0 => 'warning', 1 => 'success', 2 => 'secondary', 3 => 'warning', 4 => 'info', 5 => 'secondary', 10 => 'danger', ]; protected $table = 'user_credit_items'; protected $casts = [ 'user_id' => 'int', 'user_credit_id' => 'int', 'user_business_id' => 'int', 'credit' => 'float', 'status' => 'int', 'paid' => 'bool' ]; protected $fillable = [ 'user_id', 'user_credit_id', 'user_business_id', 'credit', 'message', 'status', 'paid' ]; public function user_credit() { return $this->belongsTo(UserCredit::class); } public function user() { return $this->belongsTo(User::class); } public function deleteTime(){ $time = '+100 min'; if(Carbon::parse($this->created_at)->modify($time)->gt(Carbon::now())){ return Carbon::now()->diffInMinutes(Carbon::parse($this->created_at)->modify($time)); } return false; } public function getStatusType(){ return isset(self::$statusTypes[$this->status]) ? self::$statusTypes[$this->status] : ""; } public function getStatusColor(){ return isset(self::$statusColors[$this->status]) ? self::$statusColors[$this->status] : "default"; } }