Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
751 B
PHP
Raw Permalink Normal View History

2018-09-11 07:51:35 -05:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
2021-03-30 11:14:34 +02:00
use Illuminate\Database\Eloquent\Relations\BelongsTo;
2018-09-11 07:51:35 -05:00
class UserWidget extends Model
{
public $timestamps = false;
protected $table = 'users_widgets';
protected $primaryKey = 'user_widget_id';
2022-05-31 08:08:40 -05:00
protected $fillable = ['user_id', 'widget', 'col', 'row', 'size_x', 'size_y', 'title', 'refresh', 'settings', 'dashboard_id'];
2018-09-11 07:51:35 -05:00
protected $casts = ['settings' => 'array'];
// ---- Define Relationships ----
2021-03-30 11:14:34 +02:00
public function user(): BelongsTo
2018-09-11 07:51:35 -05:00
{
return $this->belongsTo(\App\Models\User::class, 'user_id');
2018-09-11 07:51:35 -05:00
}
2021-03-30 11:14:34 +02:00
public function dashboard(): BelongsTo
2018-09-11 07:51:35 -05:00
{
return $this->belongsTo(\App\Models\Dashboard::class, 'dashboard_id');
2018-09-11 07:51:35 -05:00
}
}