36 lines
785 B
PHP
36 lines
785 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* @property string|null $investor_id
|
|
* @property string $status
|
|
*/
|
|
class Lead extends CrmRecord
|
|
{
|
|
protected $table = 'leads';
|
|
|
|
protected $casts = ['estimated_amount' => 'decimal:2'];
|
|
|
|
/** @return BelongsTo<Investor, $this> */
|
|
public function investor(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Investor::class);
|
|
}
|
|
|
|
/** @return BelongsTo<User, $this> */
|
|
public function owner(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'owner_user_id');
|
|
}
|
|
|
|
/** @return HasMany<CrmTask, $this> */
|
|
public function tasks(): HasMany
|
|
{
|
|
return $this->hasMany(CrmTask::class);
|
|
}
|
|
}
|