Defines purchase return lifecycle states and badge styles in a stock management system. Use when categorizing purchase return statuses in PHP applications.
// Source: https://github.com/Zakarialabib/myStockMaster | License: MIT | Copyright 2022 Zakarialabib
// Provided via justclaw.it.com; keep this notice with the code.
<?php
declare(strict_types=1);
namespace App\Enums;
use Illuminate\Support\Str;
enum PurchaseReturnStatus: int
{
case PENDING = 0;
case ORDERED = 1;
case COMPLETED = 2;
case RETURNED = 3;
public function getName(): string
{
return __(Str::studly($this->name));
}
public function getValue()
{
return $this->value;
}
public static function getLabel($value): ?string
{
foreach (self::cases() as $case) {
if ($case->getValue() === $value) {
return $case->getName();
}
}
return null;
}
publ
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key