Update Member Import
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Str;
|
||||
@@ -12,6 +13,7 @@ class CorporatePolicy extends Model
|
||||
|
||||
protected $fillable = [
|
||||
'corporate_id',
|
||||
// 'policy_id',
|
||||
'code',
|
||||
'total_premi',
|
||||
'minimal_deposit_percentage',
|
||||
@@ -34,4 +36,19 @@ class CorporatePolicy extends Model
|
||||
{
|
||||
$this->attributes['code'] = !empty($value) ? $value : Str::upper(Str::random('6'));
|
||||
}
|
||||
|
||||
// public function setPolicyIdAttribute($value)
|
||||
// {
|
||||
// $this->attributes['policy_id'] = !empty($value) ? $value : Str::upper(Str::random('6'));
|
||||
// }
|
||||
|
||||
public function setStartAttribute($value)
|
||||
{
|
||||
$this->attributes['start'] = !empty($value) ? Carbon::parse($value)->format('Y-m-d') : null;
|
||||
}
|
||||
|
||||
public function setEndAttribute($value)
|
||||
{
|
||||
$this->attributes['end'] = !empty($value) ? Carbon::parse($value)->format('Y-m-d') : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user