optimizations
This commit is contained in:
40
app/Models/NovaCardTemplate.php
Normal file
40
app/Models/NovaCardTemplate.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class NovaCardTemplate extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'slug',
|
||||
'name',
|
||||
'description',
|
||||
'preview_image',
|
||||
'config_json',
|
||||
'supported_formats',
|
||||
'active',
|
||||
'official',
|
||||
'order_num',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'config_json' => 'array',
|
||||
'supported_formats' => 'array',
|
||||
'active' => 'boolean',
|
||||
'official' => 'boolean',
|
||||
'order_num' => 'integer',
|
||||
];
|
||||
|
||||
public function cards(): HasMany
|
||||
{
|
||||
return $this->hasMany(NovaCard::class, 'template_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user