initial commit
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\BelongsToOrganization;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
#[Fillable(['establishment_id', 'machine_id', 'machine_type', 'day_type', 'slot_start', 'slot_end', 'price', 'label', 'requires_app', 'priority', 'is_active'])]
|
||||
class PricingRule extends Model
|
||||
{
|
||||
use BelongsToOrganization;
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'machine_type' => 'string',
|
||||
'day_type' => 'string',
|
||||
'slot_start' => 'datetime:H:i:s',
|
||||
'slot_end' => 'datetime:H:i:s',
|
||||
'price' => 'decimal:2',
|
||||
'requires_app' => 'boolean',
|
||||
'priority' => 'integer',
|
||||
'is_active' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function establishment(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Establishment::class);
|
||||
}
|
||||
|
||||
public function machine(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Machine::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user