PHP Classes

File: app/Enums/ProductStatus.php

Recommend this page to a friend!
  Classes of Hicri   Laravel Simple E-commerce   app/Enums/ProductStatus.php   Download  
File: app/Enums/ProductStatus.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Laravel Simple E-commerce
Show and sell products on a Web site
Author: By
Last change:
Date: Yesterday
Size: 311 bytes
 

Contents

Class file image Download
<?php

namespace App\Enums;

enum ProductStatus
{
    case
DRAFT;
    case
ACTIVE;
    case
ARCHIVED;

    public function
label(): string
   
{
        return
match ($this) {
           
self::DRAFT => 'Draft',
           
self::ACTIVE => 'Active',
           
self::ARCHIVED => 'Archived',
        };
    }
}