42 lines
783 B
PHP
42 lines
783 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class Annotation extends Model
|
|
{
|
|
protected $fillable = [
|
|
'website_id',
|
|
'user_id',
|
|
'date',
|
|
'text',
|
|
'category',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'date' => 'date',
|
|
];
|
|
}
|
|
|
|
public function website(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Website::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
public static array $categories = [
|
|
'general' => 'General',
|
|
'deployment' => 'Deployment',
|
|
'campaign' => 'Campaign',
|
|
'incident' => 'Incident',
|
|
];
|
|
}
|