'boolean', ]; /** * Relationship: the user who redeemed the activation key (optional). */ public function user() { return $this->belongsTo(User::class); } /** * Scope to filter unactivated keys */ #[Scope] protected function unactivated($query) { return $query->where('is_activated', false); } /** * Scope to filter activated keys */ #[Scope] protected function activated($query) { return $query->where('is_activated', true); } }