Files
Kol-Manager/app/Models/ContentBrief.php
I-Fun 22f03ccca7 Add contract management and invoice settings pages
- Created a new Blade view for managing brand contracts with forms for adding and editing contracts, including client and category selection.
- Implemented success message notifications for contract actions.
- Added a new Blade view for invoice settings, allowing customization of invoice number format, header branding, and default values for new invoices.
- Introduced a new PDF view for generating rate cards with customizable styles based on user profile settings.
- Developed a profile management page for rate cards, enabling users to update their identity, appearance, and visibility settings.
2026-04-01 21:47:34 +07:00

49 lines
1.2 KiB
PHP

<?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', 'category_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 category(): BelongsTo
{
return $this->belongsTo(ClientCategory::class, 'category_id');
}
public function getPlatformIconAttribute(): string
{
return match($this->platform) {
'instagram' => '📸',
'tiktok' => '🎵',
'youtube' => '▶️',
default => '📱',
};
}
}