Save storage on initial creation
This commit is contained in:
@@ -10,12 +10,19 @@ class LocalFileVolume extends BaseModel
|
|||||||
use HasFactory;
|
use HasFactory;
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
|
protected static function booted()
|
||||||
|
{
|
||||||
|
static::created(function (LocalFileVolume $fileVolume) {
|
||||||
|
$fileVolume->saveStorageOnServer($fileVolume->service);
|
||||||
|
});
|
||||||
|
}
|
||||||
public function service()
|
public function service()
|
||||||
{
|
{
|
||||||
return $this->morphTo('resource');
|
return $this->morphTo('resource');
|
||||||
}
|
}
|
||||||
public function saveStorageOnServer(ServiceApplication|ServiceDatabase $service)
|
public function saveStorageOnServer(ServiceApplication|ServiceDatabase $service)
|
||||||
{
|
{
|
||||||
|
ray('saveStorageOnServer');
|
||||||
$workdir = $service->service->workdir();
|
$workdir = $service->service->workdir();
|
||||||
$server = $service->service->server;
|
$server = $service->service->server;
|
||||||
$commands = collect([
|
$commands = collect([
|
||||||
|
|||||||
Reference in New Issue
Block a user