This commit is contained in:
Saeed Vaziry
2025-06-04 08:08:20 +02:00
parent efacadba10
commit c3f69f3247
114 changed files with 4032 additions and 765 deletions

View File

@ -4,6 +4,7 @@
use App\Exceptions\SSHError;
use App\Models\Site;
use Illuminate\Support\Facades\Validator;
class UpdateEnv
{
@ -14,10 +15,14 @@ class UpdateEnv
*/
public function update(Site $site, array $input): void
{
$site->server->os()->editFileAs(
Validator::make($input, [
'env' => ['required', 'string'],
])->validate();
$site->server->os()->write(
$site->path.'/.env',
$site->user,
trim((string) $input['env']),
$site->user,
);
}
}