Add payment status
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Repos\Order\OrderRepo;
|
||||
use App\Repos\System\Settings\Location\RegionRepo;
|
||||
use Laravel\Nova\Fields\Badge;
|
||||
use Laravel\Nova\Fields\BelongsTo;
|
||||
use Laravel\Nova\Fields\Boolean;
|
||||
use Laravel\Nova\Fields\DateTime;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Fields\Select;
|
||||
@@ -52,6 +53,8 @@ class CardOrderFieldsForIndex
|
||||
|
||||
Text::make(__('Phone'), 'phone'),
|
||||
|
||||
Boolean::make(__('Paid'), 'paid'),
|
||||
|
||||
Badge::make(__('Status'), 'status')
|
||||
->map(OrderRepo::statusClasses())
|
||||
->addTypes([
|
||||
|
||||
27
app/Repos/Payment/PaymentStatusRepo.php
Normal file
27
app/Repos/Payment/PaymentStatusRepo.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repos\Payment;
|
||||
|
||||
class PaymentStatusRepo
|
||||
{
|
||||
/**
|
||||
* Resource has been paid
|
||||
*/
|
||||
public const PAID = 'paid';
|
||||
|
||||
/**
|
||||
* Resource has not been paid
|
||||
*/
|
||||
public const UNPAID = 'unpaid';
|
||||
|
||||
/**
|
||||
* Payment statuses
|
||||
*/
|
||||
public static function values(): array
|
||||
{
|
||||
return [
|
||||
self::PAID => __('Paid'),
|
||||
self::UNPAID => __('Unpaid'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user