refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
87
app/Models/Contact/Occupation.php
Normal file
87
app/Models/Contact/Occupation.php
Normal file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Contact;
|
||||
|
||||
use App\Models\Account\Account;
|
||||
use App\Models\Account\Company;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Occupation extends Model
|
||||
{
|
||||
protected $table = 'occupations';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $fillable = [
|
||||
'account_id',
|
||||
'contact_id',
|
||||
'company_id',
|
||||
'title',
|
||||
'description',
|
||||
'salary',
|
||||
'salary_unit',
|
||||
'currently_works_here',
|
||||
'start_date',
|
||||
'end_date',
|
||||
];
|
||||
|
||||
/**
|
||||
* Valid value for salary unit.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $salaryUnits = [
|
||||
'year', 'month', 'week', 'day', 'hour',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array<string, string>
|
||||
*/
|
||||
protected $casts = [
|
||||
'start_date' => 'datetime:Y-m-d',
|
||||
'end_date' => 'datetime:Y-m-d',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array<string>|bool
|
||||
*/
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* Get the account record associated with the occupation.
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function account()
|
||||
{
|
||||
return $this->belongsTo(Account::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the contact record associated with the occupation.
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function contact()
|
||||
{
|
||||
return $this->belongsTo(Contact::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the company record associated with the occupation.
|
||||
*
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function company()
|
||||
{
|
||||
return $this->belongsTo(Company::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user