mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
update: Company,Contact,User model files - change accordingly based on new db structure.
This commit is contained in:
+8
-15
@@ -2,20 +2,20 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
|
||||
/**
|
||||
* Class Contact
|
||||
* @package App\Models
|
||||
*
|
||||
* @property \App\Models\Country country_id
|
||||
* @property \App\Models\Company company_id
|
||||
* @property int owner_id
|
||||
* @property string owner_type
|
||||
* @property string reference
|
||||
* @property string phone
|
||||
* @property string email
|
||||
* @property string wechat_id
|
||||
* @property int default
|
||||
*/
|
||||
class Contact extends AbstractModel
|
||||
{
|
||||
@@ -26,18 +26,11 @@ class Contact extends AbstractModel
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
**/
|
||||
public function company(): HasOne
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||
*/
|
||||
public function owner(): morphTo
|
||||
{
|
||||
return $this->hasOne(Company::class);
|
||||
return $this->morphTo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return belongsTo
|
||||
**/
|
||||
public function country(): belongsTo
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user