24 lines
433 B
PHP
24 lines
433 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Note extends Model
|
|
{
|
|
protected $fillable = [
|
|
'device_id', 'title', 'body', 'meta_json',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['meta_json' => 'array'];
|
|
}
|
|
|
|
public function device(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Device::class);
|
|
}
|
|
}
|