Skip to content

Open-source event management and ticket selling platform — perfect for concerts, conferences, and everything in between 🎟️ If you find this project helpful, please consider giving us a star ⭐️

891 B
Raw Blame
<?php

declare(strict_types=1);

namespace Tests\Feature\Repository\Fixtures;

use HiEvents\Models\BaseModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;

class WidgetModel extends BaseModel
{
    use SoftDeletes;

    protected $table = 'br_test_widgets';

    protected function getFillableFields(): array
    {
        return [
            'category_id',
            'name',
            'sku',
            'quantity',
            'price',
            'is_active',
            'description',
        ];
    }

    protected function getCastMap(): array
    {
        return [
            'is_active' => 'boolean',
            'quantity' => 'integer',
            'price' => 'float',
        ];
    }

    public function category(): BelongsTo
    {
        return $this->belongsTo(WidgetCategoryModel::class, 'category_id');
    }
}