@@ -0,0 +1,35 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user