37 خطوط
865 B
PHP
37 خطوط
865 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
class SalesScript extends Model
|
|
{
|
|
protected $fillable = ['title', 'description', 'campaign_id', 'product_id', 'version', 'is_active', 'checklist', 'objection_handling'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_active' => 'boolean',
|
|
'checklist' => 'array',
|
|
'objection_handling' => 'array',
|
|
];
|
|
}
|
|
|
|
public function campaign(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Campaign::class);
|
|
}
|
|
|
|
public function product(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Product::class);
|
|
}
|
|
|
|
public function sections(): HasMany
|
|
{
|
|
return $this->hasMany(ScriptSection::class);
|
|
}
|
|
}
|