mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-23 09:40:39 +00:00
api resource refactoring part 3
This commit is contained in:
@@ -84,32 +84,6 @@ class File extends Model
|
||||
$this->public_access = $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format created at date
|
||||
*/
|
||||
public function getCreatedAtAttribute(): string
|
||||
{
|
||||
return format_date(
|
||||
set_time_by_user_timezone($this->attributes['created_at']),
|
||||
__t('time')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format deleted at date reformat
|
||||
*/
|
||||
public function getDeletedAtAttribute(): string | null
|
||||
{
|
||||
if (! $this->attributes['deleted_at']) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return format_date(
|
||||
set_time_by_user_timezone($this->attributes['deleted_at']),
|
||||
__t('time')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Format fileSize
|
||||
*/
|
||||
|
||||
@@ -29,12 +29,15 @@ class FileResource extends JsonResource
|
||||
'thumbnail' => $this->thumbnail,
|
||||
'metadata' => $this->metadata,
|
||||
'folder_id' => $this->folder_id,
|
||||
'updated_at' => format_date(
|
||||
'updated_at' => $this->updated_at,
|
||||
'created_at' => $this->created_at,
|
||||
'deleted_at' => $this->deleted_at,
|
||||
/*'updated_at' => format_date(
|
||||
set_time_by_user_timezone($this->updated_at), __t('time')
|
||||
),
|
||||
'created_at' => format_date(
|
||||
set_time_by_user_timezone($this->created_at), __t('time')
|
||||
),
|
||||
),*/
|
||||
],
|
||||
'relationships' => [
|
||||
$this->mergeWhen($this->shared, fn() => [
|
||||
|
||||
Reference in New Issue
Block a user