30 خطوط
710 B
PHP
30 خطوط
710 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
class SavedView extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $fillable = ['user_id', 'team_id', 'entity_type', 'name', 'visibility', 'filters', 'columns', 'sort', 'is_default'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['filters' => 'array', 'columns' => 'array', 'sort' => 'array', 'is_default' => 'boolean'];
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public function team(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Team::class);
|
|
}
|
|
}
|