age" /> */ public function __construct(int $age = 18, ?string $type = null) { $this->age = $age; $this->label = $age >= 18 ? 'Adult' : 'Under 18'; $this->type = $type ?? ($age >= 18 ? 'success' : 'warning'); } /** * Trả về view đại diện cho component. */ public function render(): View|Closure|string { return view('components.badge'); } }