Save storage on initial creation
This commit is contained in:
parent
93e4fc2f32
commit
4b08abc144
1 changed files with 7 additions and 0 deletions
|
|
@ -10,12 +10,19 @@ class LocalFileVolume extends BaseModel
|
|||
use HasFactory;
|
||||
protected $guarded = [];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::created(function (LocalFileVolume $fileVolume) {
|
||||
$fileVolume->saveStorageOnServer($fileVolume->service);
|
||||
});
|
||||
}
|
||||
public function service()
|
||||
{
|
||||
return $this->morphTo('resource');
|
||||
}
|
||||
public function saveStorageOnServer(ServiceApplication|ServiceDatabase $service)
|
||||
{
|
||||
ray('saveStorageOnServer');
|
||||
$workdir = $service->service->workdir();
|
||||
$server = $service->service->server;
|
||||
$commands = collect([
|
||||
|
|
|
|||
Loading…
Reference in a new issue