format('Y-m-d H:i:s'); } protected function coverUrl():Attribute { return Attribute::make( get: fn($value) => $this->cover ? (Str::startsWith($this->cover, ['http://', 'https://']) ? $this->cover : Storage::url($this->cover)) : null, ); } public function scopeShow($q){ $q->where('is_enable', true); } public function scopeSort($q) { $q->orderBy('awarded_date', 'desc') ->orderBy('sort', 'asc') ->orderBy('created_at', 'desc'); } }