40 lines
1.1 KiB
PHP
40 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\HasPublication;
|
|
use App\Policies\WeddingPackagePolicy;
|
|
use Database\Factories\WeddingPackageFactory;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Attributes\UsePolicy;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
/**
|
|
* @property string $name
|
|
* @property string $level
|
|
* @property string $summary
|
|
* @property list<string> $scope_items
|
|
* @property string $cta_label
|
|
* @property int $sort_order
|
|
* @property Carbon|null $published_at
|
|
*/
|
|
#[Fillable(['name', 'level', 'summary', 'scope_items', 'cta_label', 'sort_order', 'published_at'])]
|
|
#[UsePolicy(WeddingPackagePolicy::class)]
|
|
class WeddingPackage extends Model
|
|
{
|
|
/** @use HasFactory<WeddingPackageFactory> */
|
|
use HasFactory;
|
|
|
|
use HasPublication;
|
|
|
|
/** @return array<string, string|class-string> */
|
|
protected function casts(): array
|
|
{
|
|
return ['scope_items' => 'array', 'sort_order' => 'integer', 'published_at' => 'datetime'];
|
|
}
|
|
}
|