mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
Update: laravel 8 to 12, php 7.3 to php 8.3, Jenkinsfile, Unit/Feature testing, vapor, docker
This commit is contained in:
+24
-15
@@ -7,22 +7,21 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\hasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* Class Document
|
||||
* @package App\Models
|
||||
* @version August 4, 2020, 4:36 am
|
||||
*
|
||||
* @property int owner_id
|
||||
* @property int owner_type
|
||||
* @property int document_type
|
||||
* @property string reference
|
||||
* @property int status
|
||||
* @property \App\Models\User approver
|
||||
* @property timestamp issued_date
|
||||
* @property timestamp expired_date
|
||||
* @property timestamp approved_date
|
||||
* @property int $owner_id
|
||||
* @property int $owner_type
|
||||
* @property int $document_type
|
||||
* @property string $reference
|
||||
* @property int $status
|
||||
* @property int $approver
|
||||
* @property string $issued_date
|
||||
* @property string $expired_date
|
||||
* @property string $approved_date
|
||||
*/
|
||||
class Document extends AbstractModel
|
||||
{
|
||||
@@ -30,7 +29,17 @@ class Document extends AbstractModel
|
||||
|
||||
protected $table = 'documents';
|
||||
|
||||
protected $dates = ['deleted_at'];
|
||||
/**
|
||||
* Get the attributes that should be cast.
|
||||
*
|
||||
* @return array<string, string>
|
||||
*/
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'deleted_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\MorphTo
|
||||
@@ -41,9 +50,9 @@ class Document extends AbstractModel
|
||||
}
|
||||
|
||||
/**
|
||||
* @return hasMany
|
||||
* @return HasMany
|
||||
*/
|
||||
public function files(): hasMany
|
||||
public function files(): HasMany
|
||||
{
|
||||
return $this->hasMany(File::class, 'document_id');
|
||||
}
|
||||
@@ -51,7 +60,7 @@ class Document extends AbstractModel
|
||||
/**
|
||||
* @return HasOne
|
||||
*/
|
||||
public function approver(): hasOne
|
||||
public function approver(): HasOne
|
||||
{
|
||||
return $this->hasOne(User::class, 'id', 'approver');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user