migrate template
This commit is contained in:
37
app/Models/SignatureItem.php
Normal file
37
app/Models/SignatureItem.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Database\Factories\SignatureItemFactory;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SignatureItem extends Model
|
||||
{
|
||||
/** @use HasFactory<SignatureItemFactory> */
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'price',
|
||||
'price_unit',
|
||||
'description',
|
||||
'image',
|
||||
'sort_order',
|
||||
'is_active',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'price' => 'decimal:2',
|
||||
'is_active' => 'boolean',
|
||||
'sort_order' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
public function scopeActive($query): void
|
||||
{
|
||||
$query->where('is_active', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user