Updated project for admin panel

This commit is contained in:
2022-02-15 22:35:59 +01:00
parent 984d2eeae6
commit 282e5ccc46
13 changed files with 371 additions and 14 deletions

View File

@@ -25,6 +25,8 @@ class Project extends Model
// use HasFactory;
protected $dateFormat = 'Y-m-d';
protected $guarded = [];
protected $casts = [
'id' => 'integer',
@@ -32,10 +34,34 @@ class Project extends Model
'categories' => 'array',
'author' => 'string',
'images' => 'array',
'release_data' => 'datetime:d-m-Y',
'release_date' => 'datetime:Y-m-d',
'update_date' => 'datetime:Y-m-d',
'project_url' => 'string',
'project_version' => 'string',
'description' => 'string'
];
public function getReleaseDateAttribute($value): String
{
return $value;
}
public function setReleaseDateAttribute($value): void
{
$this->attributes['release_date'] = $value;
}
public function getUpdateDateAttribute($value): String|null
{
return $value;
}
public function setUpdateDateAttribute($value): void
{
if (!is_null($value))
$this->attributes['update_date'] = $value;
else
$this->attributes['update_date'] = null;
}
}