where('key', $key)->first(); } public function isPaid(): bool { return $this->price > 0; } /** * What the dashboard is allowed to see. The price is in ringgit here. * * @return array */ public function toDisplay(): array { return [ 'key' => $this->key, 'name' => $this->name, 'price' => $this->price / 100, 'stores' => $this->stores, 'regenerations' => $this->regenerations, 'edits' => $this->edits, 'period' => $this->period, ]; } /** * @return array */ protected function casts(): array { return [ 'price' => 'integer', 'stores' => 'integer', 'regenerations' => 'integer', 'edits' => 'integer', 'sort' => 'integer', ]; } }