Update Member Import

This commit is contained in:
2022-07-25 10:20:35 +07:00
parent 42e4129a79
commit 1edd8157c7
71 changed files with 1917 additions and 2743 deletions

View File

@@ -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;
}
}