[WIP] Fix Person
This commit is contained in:
@@ -20,6 +20,10 @@ class File extends Model
|
||||
'path',
|
||||
];
|
||||
|
||||
public $appends = [
|
||||
'url'
|
||||
];
|
||||
|
||||
public static $file_directories = [
|
||||
'import-temp' => 'import-temp/',
|
||||
'avatar' => 'user-avatar/',
|
||||
@@ -41,6 +45,11 @@ class File extends Model
|
||||
return $type . '-' . $id . '-' . Str::random(10);
|
||||
}
|
||||
|
||||
public function getUrlAttribute()
|
||||
{
|
||||
return url($this->path);
|
||||
}
|
||||
|
||||
public static function storeFile($type, $id, $file)
|
||||
{
|
||||
$fileName = self::getFileName($type, $id);
|
||||
|
||||
Reference in New Issue
Block a user