Update to Laravel 5.5 (#814)
This commit is contained in:
parent
f9df463d32
commit
b9d67459b2
35 changed files with 1021 additions and 818 deletions
|
@ -9,8 +9,6 @@
|
|||
|
||||
namespace Pterodactyl\Models;
|
||||
|
||||
use File;
|
||||
use Storage;
|
||||
use Sofa\Eloquence\Eloquence;
|
||||
use Sofa\Eloquence\Validable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
@ -88,30 +86,6 @@ class Pack extends Model implements CleansAttributes, ValidableContract
|
|||
'version' => 2,
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns all of the archived files for a given pack.
|
||||
*
|
||||
* @param bool $collection
|
||||
* @return \Illuminate\Support\Collection|object
|
||||
* @deprecated
|
||||
*/
|
||||
public function files($collection = false)
|
||||
{
|
||||
$files = collect(Storage::files('packs/' . $this->uuid));
|
||||
|
||||
$files = $files->map(function ($item) {
|
||||
$path = storage_path('app/' . $item);
|
||||
|
||||
return (object) [
|
||||
'name' => basename($item),
|
||||
'hash' => sha1_file($path),
|
||||
'size' => File::humanReadableSize($path),
|
||||
];
|
||||
});
|
||||
|
||||
return ($collection) ? $files : (object) $files->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets egg associated with a service pack.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue