initial commit
This commit is contained in:
43
app/Models/ContentBrief.php
Normal file
43
app/Models/ContentBrief.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\ContentStatus;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class ContentBrief extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'client_id', 'title', 'platform', 'content_type', 'status',
|
||||
'hook', 'body', 'cta', 'script', 'caption', 'hashtags',
|
||||
'target_date', 'posted_date', 'posted_url', 'sort_order', 'notes',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'status' => ContentStatus::class,
|
||||
'target_date' => 'date',
|
||||
'posted_date' => 'date',
|
||||
];
|
||||
|
||||
public function client(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Client::class);
|
||||
}
|
||||
|
||||
public function getPlatformIconAttribute(): string
|
||||
{
|
||||
return match($this->platform) {
|
||||
'instagram' => '📸',
|
||||
'tiktok' => '🎵',
|
||||
'youtube' => '▶️',
|
||||
default => '📱',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user