mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/portal.git
synced 2026-09-01 02:44:13 +00:00
bulk commit
This commit is contained in:
+2
-47
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\AbstractModel as Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
|
||||
@@ -26,60 +26,15 @@ class Address extends AbstractModel
|
||||
|
||||
|
||||
protected $table = 'addresses';
|
||||
|
||||
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
|
||||
|
||||
|
||||
public $fillable = [
|
||||
'street_one',
|
||||
'street_two',
|
||||
'city',
|
||||
'state',
|
||||
'post_code',
|
||||
'country'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'street_one' => 'string',
|
||||
'street_two' => 'string',
|
||||
'city' => 'string',
|
||||
'state' => 'string',
|
||||
'post_code' => 'string',
|
||||
'country' => 'string',
|
||||
'default' => 'integer',
|
||||
'billing' => 'integer'
|
||||
];
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public static $rules = [
|
||||
'company_id' => 'required',
|
||||
'street_one' => 'required',
|
||||
'city' => 'required',
|
||||
'state' => 'required',
|
||||
'post_code' => 'required',
|
||||
'country' => 'required',
|
||||
'default' => 'required',
|
||||
'billing' => 'required'
|
||||
];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
**/
|
||||
public function company(): HasOne
|
||||
{
|
||||
return $this->hasOne(\App\Models\Company::class, 'company_id', 'id');
|
||||
return $this->hasOne(Company::class, 'company_id', 'id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user