This commit is contained in:
2025-09-25 03:03:31 +05:00
commit ae480cf2f6
2768 changed files with 1485826 additions and 0 deletions

View File

@@ -0,0 +1,72 @@
<?php
namespace App\Nova\Resources\System\Payments;
use App\Models\System\Settings\Payments\PaymentType as PaymentTypeModel;
use App\Nova\Resource;
use Laravel\Nova\Fields\ID;
use Laravel\Nova\Fields\Text;
use Laravel\Nova\Http\Requests\NovaRequest;
use Trin4ik\NovaSwitcher\NovaSwitcher;
class PaymentType extends Resource
{
/**
* The model the resource corresponds to.
*
* @var class-string<PaymentTypeModel>
*/
public static $model = PaymentTypeModel::class;
/**
* The single value that should be used to represent the resource when being displayed.
*
* @var string
*/
public static $title = 'name';
/**
* The columns that should be searched.
*
* @var array
*/
public static $search = [
'id', 'name',
];
/**
* Get the displayable label of the resource.
*/
public static function label(): string
{
return __('Payment types');
}
/**
* Get the displayable singular label of the resource.
*/
public static function singularLabel(): string
{
return __('Payment type');
}
/**
* Get the fields displayed by the resource.
*/
public function fields(NovaRequest $request): array
{
return [
ID::make()->sortable(),
Text::make(__('Name'), 'name')
->translatable()
->rules('required', 'string', 'max:255'),
Text::make(__('Tax'), 'tax')
->rules('nullable', 'string', 'max:255'),
NovaSwitcher::make(__('Is enabled'), 'is_enabled')
->default(true),
];
}
}