- Introduced routes for managing admin settings including system, homepage, social media, marketplace, and HR settings. - Created a comprehensive test suite for the AdminSettingsController to ensure proper functionality and validation of settings updates. - Implemented tests for authentication, data integrity, and realistic user scenarios to validate the settings management process.
33 lines
685 B
PHP
33 lines
685 B
PHP
<?php
|
|
|
|
namespace App\Support\Marketplace;
|
|
|
|
use Spatie\LaravelData\Data;
|
|
|
|
class MarketplaceFeeRule extends Data
|
|
{
|
|
public function __construct(
|
|
public string $base = 'per_transaksi',
|
|
public string $type = 'persentase',
|
|
public float $value = 0.0,
|
|
) {}
|
|
|
|
public static function defaultPercent(float $value): static
|
|
{
|
|
return new static(
|
|
base: 'per_transaksi',
|
|
type: 'persentase',
|
|
value: $value,
|
|
);
|
|
}
|
|
|
|
public function toArray(): array
|
|
{
|
|
return [
|
|
'base' => $this->base,
|
|
'type' => $this->type,
|
|
'value' => (float) $this->value,
|
|
];
|
|
}
|
|
}
|