23 lines
453 B
PHP
23 lines
453 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Link extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = ['title', 'url', 'icon', 'color', 'order', 'is_active'];
|
|
|
|
protected $casts = [
|
|
'is_active' => 'boolean',
|
|
];
|
|
|
|
public function scopeActive($query)
|
|
{
|
|
return $query->where('is_active', true)->orderBy('order', 'asc');
|
|
}
|
|
}
|