An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
refactor: Update code to use str() instead of Str::of() for string manipulation
Andras Bacsai2c92cc40e116
diff --git a/app/Actions/Database/StartClickhouse.php b/app/Actions/Database/StartClickhouse.phpindex d9518cd80f..e97c55930a 100644--- a/app/Actions/Database/StartClickhouse.php+++ b/app/Actions/Database/StartClickhouse.php@@ -3,7 +3,6 @@namespace App\Actions\Database;use App\Models\StandaloneClickhouse;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -155,11 +154,11 @@ class StartClickhouse$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('CLICKHOUSE_ADMIN_USER'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('CLICKHOUSE_ADMIN_USER'))->isEmpty()) {$environment_variables->push("CLICKHOUSE_ADMIN_USER={$this->database->clickhouse_admin_user}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('CLICKHOUSE_ADMIN_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('CLICKHOUSE_ADMIN_PASSWORD'))->isEmpty()) {$environment_variables->push("CLICKHOUSE_ADMIN_PASSWORD={$this->database->clickhouse_admin_password}");}diff --git a/app/Actions/Database/StartDragonfly.php b/app/Actions/Database/StartDragonfly.phpindex 19b1c58144..862fc54fc9 100644--- a/app/Actions/Database/StartDragonfly.php+++ b/app/Actions/Database/StartDragonfly.php@@ -3,7 +3,6 @@namespace App\Actions\Database;use App\Models\StandaloneDragonfly;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -155,7 +154,7 @@ class StartDragonfly$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('REDIS_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {$environment_variables->push("REDIS_PASSWORD={$this->database->dragonfly_password}");}diff --git a/app/Actions/Database/StartKeydb.php b/app/Actions/Database/StartKeydb.phpindex a632f6e8c3..85cb89c1c6 100644--- a/app/Actions/Database/StartKeydb.php+++ b/app/Actions/Database/StartKeydb.php@@ -4,7 +4,6 @@ namespace App\Actions\Database;use App\Models\StandaloneKeydb;use Illuminate\Support\Facades\Storage;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -163,7 +162,7 @@ class StartKeydb$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('REDIS_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {$environment_variables->push("REDIS_PASSWORD={$this->database->keydb_password}");}diff --git a/app/Actions/Database/StartMariadb.php b/app/Actions/Database/StartMariadb.phpindex 31d3f0640c..33948192b4 100644--- a/app/Actions/Database/StartMariadb.php+++ b/app/Actions/Database/StartMariadb.php@@ -3,7 +3,6 @@namespace App\Actions\Database;use App\Models\StandaloneMariadb;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -157,18 +156,18 @@ class StartMariadb$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_ROOT_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_ROOT_PASSWORD'))->isEmpty()) {$environment_variables->push("MARIADB_ROOT_PASSWORD={$this->database->mariadb_root_password}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_DATABASE'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_DATABASE'))->isEmpty()) {$environment_variables->push("MARIADB_DATABASE={$this->database->mariadb_database}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_USER'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_USER'))->isEmpty()) {$environment_variables->push("MARIADB_USER={$this->database->mariadb_user}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MARIADB_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MARIADB_PASSWORD'))->isEmpty()) {$environment_variables->push("MARIADB_PASSWORD={$this->database->mariadb_password}");}diff --git a/app/Actions/Database/StartMongodb.php b/app/Actions/Database/StartMongodb.phpindex 8db34b20f0..911054f5e6 100644--- a/app/Actions/Database/StartMongodb.php+++ b/app/Actions/Database/StartMongodb.php@@ -3,7 +3,6 @@namespace App\Actions\Database;use App\Models\StandaloneMongodb;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -174,15 +173,15 @@ class StartMongodb$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MONGO_INITDB_ROOT_USERNAME'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_ROOT_USERNAME'))->isEmpty()) {$environment_variables->push("MONGO_INITDB_ROOT_USERNAME={$this->database->mongo_initdb_root_username}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MONGO_INITDB_ROOT_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_ROOT_PASSWORD'))->isEmpty()) {$environment_variables->push("MONGO_INITDB_ROOT_PASSWORD={$this->database->mongo_initdb_root_password}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MONGO_INITDB_DATABASE'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MONGO_INITDB_DATABASE'))->isEmpty()) {$environment_variables->push("MONGO_INITDB_DATABASE={$this->database->mongo_initdb_database}");}diff --git a/app/Actions/Database/StartMysql.php b/app/Actions/Database/StartMysql.phpindex 8280faa563..b55d9dead1 100644--- a/app/Actions/Database/StartMysql.php+++ b/app/Actions/Database/StartMysql.php@@ -3,7 +3,6 @@namespace App\Actions\Database;use App\Models\StandaloneMysql;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -157,18 +156,18 @@ class StartMysql$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_ROOT_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_ROOT_PASSWORD'))->isEmpty()) {$environment_variables->push("MYSQL_ROOT_PASSWORD={$this->database->mysql_root_password}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_DATABASE'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_DATABASE'))->isEmpty()) {$environment_variables->push("MYSQL_DATABASE={$this->database->mysql_database}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_USER'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_USER'))->isEmpty()) {$environment_variables->push("MYSQL_USER={$this->database->mysql_user}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('MYSQL_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('MYSQL_PASSWORD'))->isEmpty()) {$environment_variables->push("MYSQL_PASSWORD={$this->database->mysql_password}");}diff --git a/app/Actions/Database/StartPostgresql.php b/app/Actions/Database/StartPostgresql.phpindex 23b9742c75..909f4c8931 100644--- a/app/Actions/Database/StartPostgresql.php+++ b/app/Actions/Database/StartPostgresql.php@@ -3,7 +3,6 @@namespace App\Actions\Database;use App\Models\StandalonePostgresql;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -179,18 +178,18 @@ class StartPostgresql$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('POSTGRES_USER'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('POSTGRES_USER'))->isEmpty()) {$environment_variables->push("POSTGRES_USER={$this->database->postgres_user}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('PGUSER'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('PGUSER'))->isEmpty()) {$environment_variables->push("PGUSER={$this->database->postgres_user}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('POSTGRES_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('POSTGRES_PASSWORD'))->isEmpty()) {$environment_variables->push("POSTGRES_PASSWORD={$this->database->postgres_password}");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('POSTGRES_DB'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('POSTGRES_DB'))->isEmpty()) {$environment_variables->push("POSTGRES_DB={$this->database->postgres_db}");}diff --git a/app/Actions/Database/StartRedis.php b/app/Actions/Database/StartRedis.phpindex 065df5e528..f10afef5e9 100644--- a/app/Actions/Database/StartRedis.php+++ b/app/Actions/Database/StartRedis.php@@ -4,7 +4,6 @@ namespace App\Actions\Database;use App\Models\StandaloneRedis;use Illuminate\Support\Facades\Storage;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Symfony\Component\Yaml\Yaml;@@ -167,7 +166,7 @@ class StartRedis$environment_variables->push("$env->key=$env->real_value");}- if ($environment_variables->filter(fn ($env) => Str::of($env)->contains('REDIS_PASSWORD'))->isEmpty()) {+ if ($environment_variables->filter(fn ($env) => str($env)->contains('REDIS_PASSWORD'))->isEmpty()) {$environment_variables->push("REDIS_PASSWORD={$this->database->redis_password}");}diff --git a/app/Actions/Proxy/CheckConfiguration.php b/app/Actions/Proxy/CheckConfiguration.phpindex 35374ba43c..3cbd5669d9 100644--- a/app/Actions/Proxy/CheckConfiguration.php+++ b/app/Actions/Proxy/CheckConfiguration.php@@ -3,7 +3,6 @@namespace App\Actions\Proxy;use App\Models\Server;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;class CheckConfiguration@@ -24,7 +23,7 @@ class CheckConfiguration$proxy_configuration = instant_remote_process($payload, $server, false);if ($reset || ! $proxy_configuration || is_null($proxy_configuration)) {- $proxy_configuration = Str::of(generate_default_proxy_configuration($server))->trim()->value;+ $proxy_configuration = str(generate_default_proxy_configuration($server))->trim()->value;}if (! $proxy_configuration || is_null($proxy_configuration)) {throw new \Exception('Could not generate proxy configuration');diff --git a/app/Actions/Proxy/SaveConfiguration.php b/app/Actions/Proxy/SaveConfiguration.phpindex 4c413ca36f..f2de2b3f5a 100644--- a/app/Actions/Proxy/SaveConfiguration.php+++ b/app/Actions/Proxy/SaveConfiguration.php@@ -3,7 +3,6 @@namespace App\Actions\Proxy;use App\Models\Server;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;class SaveConfiguration@@ -18,7 +17,7 @@ class SaveConfiguration$proxy_path = $server->proxyPath();$docker_compose_yml_base64 = base64_encode($proxy_settings);- $server->proxy->last_saved_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;+ $server->proxy->last_saved_settings = str($docker_compose_yml_base64)->pipe('md5')->value;$server->save();return instant_remote_process([diff --git a/app/Actions/Proxy/StartProxy.php b/app/Actions/Proxy/StartProxy.phpindex 710b5cdd86..341186beca 100644--- a/app/Actions/Proxy/StartProxy.php+++ b/app/Actions/Proxy/StartProxy.php@@ -4,7 +4,6 @@ namespace App\Actions\Proxy;use App\Events\ProxyStarted;use App\Models\Server;-use Illuminate\Support\Str;use Lorisleiva\Actions\Concerns\AsAction;use Spatie\Activitylog\Models\Activity;@@ -27,7 +26,7 @@ class StartProxy}SaveConfiguration::run($server, $configuration);$docker_compose_yml_base64 = base64_encode($configuration);- $server->proxy->last_applied_settings = Str::of($docker_compose_yml_base64)->pipe('md5')->value;+ $server->proxy->last_applied_settings = str($docker_compose_yml_base64)->pipe('md5')->value;$server->save();if ($server->isSwarm()) {$commands = $commands->merge([diff --git a/app/Console/Commands/WaitlistInvite.php b/app/Console/Commands/WaitlistInvite.phpindex 88ff21d46f..ff501cc1d4 100644--- a/app/Console/Commands/WaitlistInvite.php+++ b/app/Console/Commands/WaitlistInvite.php@@ -82,7 +82,7 @@ class WaitlistInvite extends Commandif (! $already_registered) {$this->password = Str::password();User::create([- 'name' => Str::of($this->next_patient->email)->before('@'),+ 'name' => str($this->next_patient->email)->before('@'),'email' => $this->next_patient->email,'password' => Hash::make($this->password),'force_password_reset' => true,diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.phpindex 3363d8164a..38d9e22729 100644--- a/app/Http/Controllers/Controller.php+++ b/app/Http/Controllers/Controller.php@@ -81,8 +81,8 @@ class Controller extends BaseController$token = request()->get('token');if ($token) {$decrypted = Crypt::decryptString($token);- $email = Str::of($decrypted)->before('@@@');- $password = Str::of($decrypted)->after('@@@');+ $email = str($decrypted)->before('@@@');+ $password = str($decrypted)->after('@@@');$user = User::whereEmail($email)->first();if (! $user) {return redirect()->route('login');diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.phpindex 2944b746d5..a18e103f65 100644--- a/app/Jobs/ApplicationDeploymentJob.php+++ b/app/Jobs/ApplicationDeploymentJob.php@@ -1076,13 +1076,13 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$this->application_deployment_queue->addLogEntry("Healthcheck logs: {$health_check_logs} | Return code: {$health_check_return_code}");}- if (Str::of($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'healthy') {+ if (str($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'healthy') {$this->newVersionIsHealthy = true;$this->application->update(['status' => 'running']);$this->application_deployment_queue->addLogEntry('New container is healthy.');break;}- if (Str::of($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'unhealthy') {+ if (str($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'unhealthy') {$this->newVersionIsHealthy = false;$this->query_logs();break;@@ -1094,7 +1094,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$sleeptime++;}}- if (Str::of($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'starting') {+ if (str($this->saved_outputs->get('health_check'))->replace('"', '')->value() === 'starting') {$this->query_logs();}}@@ -1535,7 +1535,7 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue$this->execute_remote_command([executeInDocker($this->deployment_uuid, "cat {$this->workdir}{$this->dockerfile_location}"), 'hidden' => true, 'save' => 'dockerfile_from_repo', 'ignore_errors' => true,]);- $dockerfile = collect(Str::of($this->saved_outputs->get('dockerfile_from_repo'))->trim()->explode("\n"));+ $dockerfile = collect(str($this->saved_outputs->get('dockerfile_from_repo'))->trim()->explode("\n"));$this->application->parseHealthcheckFromDockerfile($dockerfile);}$docker_compose = [@@ -2107,7 +2107,7 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf");$this->execute_remote_command([executeInDocker($this->deployment_uuid, "cat {$this->workdir}{$this->dockerfile_location}"), 'hidden' => true, 'save' => 'dockerfile',]);- $dockerfile = collect(Str::of($this->saved_outputs->get('dockerfile'))->trim()->explode("\n"));+ $dockerfile = collect(str($this->saved_outputs->get('dockerfile'))->trim()->explode("\n"));if ($this->pull_request_id === 0) {foreach ($this->application->build_environment_variables as $env) {if (data_get($env, 'is_multiline') === true) {diff --git a/app/Jobs/DatabaseBackupJob.php b/app/Jobs/DatabaseBackupJob.phpindex 07386988c0..94e0ac3a39 100644--- a/app/Jobs/DatabaseBackupJob.php+++ b/app/Jobs/DatabaseBackupJob.php@@ -98,7 +98,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueuereturn;}- $status = Str::of(data_get($this->database, 'status'));+ $status = str(data_get($this->database, 'status'));if (! $status->startsWith('running') && $this->database->id !== 0) {ray('database not running');@@ -236,7 +236,7 @@ class DatabaseBackupJob implements ShouldBeEncrypted, ShouldQueuereturn;}}- $this->backup_dir = backup_dir().'/databases/'.Str::of($this->team->name)->slug().'-'.$this->team->id.'/'.$this->directory_name;+ $this->backup_dir = backup_dir().'/databases/'.str($this->team->name)->slug().'-'.$this->team->id.'/'.$this->directory_name;if ($this->database->name === 'coolify-db') {$databasesToBackup = ['coolify'];diff --git a/app/Livewire/Project/Application/General.php b/app/Livewire/Project/Application/General.phpindex 06ff7b1dea..38eb4dce84 100644--- a/app/Livewire/Project/Application/General.php+++ b/app/Livewire/Project/Application/General.php@@ -5,7 +5,6 @@ namespace App\Livewire\Project\Application;use App\Models\Application;use App\Models\LocalFileVolume;use Illuminate\Support\Collection;-use Illuminate\Support\Str;use Livewire\Component;use Visus\Cuid2\Cuid2;@@ -199,8 +198,8 @@ class General extends Componentreturn str($volume)->startsWith('/data/coolify');})->unique()->values();foreach ($volumes as $volume) {- $source = Str::of($volume)->before(':');- $target = Str::of($volume)->after(':')->beforeLast(':');+ $source = str($volume)->before(':');+ $target = str($volume)->after(':')->beforeLast(':');LocalFileVolume::updateOrCreate([diff --git a/app/Livewire/Project/Application/Preview/Form.php b/app/Livewire/Project/Application/Preview/Form.phpindex cf5ab9c825..e4f100fcfc 100644--- a/app/Livewire/Project/Application/Preview/Form.php+++ b/app/Livewire/Project/Application/Preview/Form.php@@ -3,7 +3,6 @@namespace App\Livewire\Project\Application\Preview;use App\Models\Application;-use Illuminate\Support\Str;use Livewire\Component;use Spatie\Url\Url;@@ -32,10 +31,10 @@ class Form extends Componentpublic function generate_real_url(){if (data_get($this->application, 'fqdn')) {- $firstFqdn = Str::of($this->application->fqdn)->before(',');+ $firstFqdn = str($this->application->fqdn)->before(',');$url = Url::fromString($firstFqdn);$host = $url->getHost();- $this->preview_url_template = Str::of($this->application->preview_url_template)->replace('{{domain}}', $host);+ $this->preview_url_template = str($this->application->preview_url_template)->replace('{{domain}}', $host);}}diff --git a/app/Livewire/Project/Application/Rollback.php b/app/Livewire/Project/Application/Rollback.phpindex 41fe598b15..ed0ac1cef1 100644--- a/app/Livewire/Project/Application/Rollback.php+++ b/app/Livewire/Project/Application/Rollback.php@@ -3,7 +3,6 @@namespace App\Livewire\Project\Application;use App\Models\Application;-use Illuminate\Support\Str;use Livewire\Component;use Visus\Cuid2\Cuid2;@@ -50,16 +49,16 @@ class Rollback extends Component$output = instant_remote_process(["docker inspect --format='{{.Config.Image}}' {$this->application->uuid}",], $this->application->destination->server, throwError: false);- $current_tag = Str::of($output)->trim()->explode(':');+ $current_tag = str($output)->trim()->explode(':');$this->current = data_get($current_tag, 1);$output = instant_remote_process(["docker images --format '{{.Repository}}#{{.Tag}}#{{.CreatedAt}}'",], $this->application->destination->server);- $this->images = Str::of($output)->trim()->explode("\n")->filter(function ($item) use ($image) {- return Str::of($item)->contains($image);+ $this->images = str($output)->trim()->explode("\n")->filter(function ($item) use ($image) {+ return str($item)->contains($image);})->map(function ($item) {- $item = Str::of($item)->explode('#');+ $item = str($item)->explode('#');if ($item[1] === $this->current) {// $is_current = true;}diff --git a/app/Livewire/Project/New/DockerImage.php b/app/Livewire/Project/New/DockerImage.phpindex 65a98b37f1..fdad052c73 100644--- a/app/Livewire/Project/New/DockerImage.php+++ b/app/Livewire/Project/New/DockerImage.php@@ -6,7 +6,6 @@ use App\Models\Application;use App\Models\Project;use App\Models\StandaloneDocker;use App\Models\SwarmDocker;-use Illuminate\Support\Str;use Livewire\Component;use Visus\Cuid2\Cuid2;@@ -29,9 +28,9 @@ class DockerImage extends Component$this->validate(['dockerImage' => 'required',]);- $image = Str::of($this->dockerImage)->before(':');- if (Str::of($this->dockerImage)->contains(':')) {- $tag = Str::of($this->dockerImage)->after(':');+ $image = str($this->dockerImage)->before(':');+ if (str($this->dockerImage)->contains(':')) {+ $tag = str($this->dockerImage)->after(':');} else {$tag = 'latest';}diff --git a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.phpindex 690149cc42..a35a925163 100644--- a/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php+++ b/app/Livewire/Project/New/GithubPrivateRepositoryDeployKey.php@@ -193,7 +193,7 @@ class GithubPrivateRepositoryDeployKey extends Componentreturn;}- if (Str::of($this->repository_url)->startsWith('http')) {+ if (str($this->repository_url)->startsWith('http')) {$this->git_host = $this->repository_url_parsed->getHost();$this->git_repository = $this->repository_url_parsed->getSegment(1).'/'.$this->repository_url_parsed->getSegment(2);$this->git_repository = Str::finish("git@$this->git_host:$this->git_repository", '.git');diff --git a/app/Livewire/Project/Service/FileStorage.php b/app/Livewire/Project/Service/FileStorage.phpindex 201ebf58ff..2eea0891f1 100644--- a/app/Livewire/Project/Service/FileStorage.php+++ b/app/Livewire/Project/Service/FileStorage.php@@ -14,7 +14,6 @@ use App\Models\StandaloneMongodb;use App\Models\StandaloneMysql;use App\Models\StandalonePostgresql;use App\Models\StandaloneRedis;-use Illuminate\Support\Str;use Livewire\Component;class FileStorage extends Component@@ -37,9 +36,9 @@ class FileStorage extends Componentpublic function mount(){$this->resource = $this->fileStorage->service;- if (Str::of($this->fileStorage->fs_path)->startsWith('.')) {+ if (str($this->fileStorage->fs_path)->startsWith('.')) {$this->workdir = $this->resource->service?->workdir();- $this->fs_path = Str::of($this->fileStorage->fs_path)->after('.');+ $this->fs_path = str($this->fileStorage->fs_path)->after('.');} else {$this->workdir = null;$this->fs_path = $this->fileStorage->fs_path;diff --git a/app/Livewire/Server/Proxy.php b/app/Livewire/Server/Proxy.phpindex 8d1ece1c68..a170ee0295 100644--- a/app/Livewire/Server/Proxy.php+++ b/app/Livewire/Server/Proxy.php@@ -6,7 +6,6 @@ use App\Actions\Proxy\CheckConfiguration;use App\Actions\Proxy\SaveConfiguration;use App\Actions\Proxy\StartProxy;use App\Models\Server;-use Illuminate\Support\Str;use Livewire\Component;class Proxy extends Component@@ -79,7 +78,7 @@ class Proxy extends Component{try {$this->proxy_settings = CheckConfiguration::run($this->server);- if (Str::of($this->proxy_settings)->contains('--api.dashboard=true') && Str::of($this->proxy_settings)->contains('--api.insecure=true')) {+ if (str($this->proxy_settings)->contains('--api.dashboard=true') && str($this->proxy_settings)->contains('--api.insecure=true')) {$this->dispatch('traefikDashboardAvailable', true);} else {$this->dispatch('traefikDashboardAvailable', false);diff --git a/app/Livewire/Team/InviteLink.php b/app/Livewire/Team/InviteLink.phpindex cc69e66503..0fa9e980c3 100644--- a/app/Livewire/Team/InviteLink.php+++ b/app/Livewire/Team/InviteLink.php@@ -52,7 +52,7 @@ class InviteLink extends Componentif (is_null($user)) {$password = Str::password();$user = User::create([- 'name' => Str::of($this->email)->before('@'),+ 'name' => str($this->email)->before('@'),'email' => $this->email,'password' => Hash::make($password),'force_password_reset' => true,diff --git a/app/Models/Application.php b/app/Models/Application.phpindex 50c7760ff6..9c27fc9382 100644--- a/app/Models/Application.php+++ b/app/Models/Application.php@@ -28,11 +28,11 @@ class Application extends BaseModel}$application->forceFill(['fqdn' => $application->fqdn,- 'install_command' => Str::of($application->install_command)->trim(),- 'build_command' => Str::of($application->build_command)->trim(),- 'start_command' => Str::of($application->start_command)->trim(),- 'base_directory' => Str::of($application->base_directory)->trim(),- 'publish_directory' => Str::of($application->publish_directory)->trim(),+ 'install_command' => str($application->install_command)->trim(),+ 'build_command' => str($application->build_command)->trim(),+ 'start_command' => str($application->start_command)->trim(),+ 'base_directory' => str($application->base_directory)->trim(),+ 'publish_directory' => str($application->publish_directory)->trim(),]);});static::created(function ($application) {@@ -902,9 +902,9 @@ class Application extends BaseModel$type = null;$source = null;if (is_string($volume)) {- $source = Str::of($volume)->before(':');+ $source = str($volume)->before(':');if ($source->startsWith('./') || $source->startsWith('/') || $source->startsWith('~')) {- $type = Str::of('bind');+ $type = str('bind');}} elseif (is_array($volume)) {$type = data_get_str($volume, 'type');diff --git a/app/Models/EnvironmentVariable.php b/app/Models/EnvironmentVariable.phpindex ff63bca5ac..8731eab2d5 100644--- a/app/Models/EnvironmentVariable.php+++ b/app/Models/EnvironmentVariable.php@@ -174,7 +174,7 @@ class EnvironmentVariable extends Modelif (str($environment_variable)->startsWith('{{'.$type) && str($environment_variable)->endsWith('}}')) {$variable = Str::after($environment_variable, "{$type}.");$variable = Str::before($variable, '}}');- $variable = Str::of($variable)->trim()->value;+ $variable = str($variable)->trim()->value;if (! collect(SHARED_VARIABLE_TYPES)->contains($type)) {return $variable;}@@ -220,7 +220,7 @@ class EnvironmentVariable extends Modelprotected function key(): Attribute{return Attribute::make(- set: fn (string $value) => Str::of($value)->trim(),+ set: fn (string $value) => str($value)->trim(),);}}diff --git a/app/Models/LocalPersistentVolume.php b/app/Models/LocalPersistentVolume.phpindex e48b8b4051..68e476365a 100644--- a/app/Models/LocalPersistentVolume.php+++ b/app/Models/LocalPersistentVolume.php@@ -4,7 +4,6 @@ namespace App\Models;use Illuminate\Database\Eloquent\Casts\Attribute;use Illuminate\Database\Eloquent\Model;-use Illuminate\Support\Str;class LocalPersistentVolume extends Model{@@ -33,14 +32,14 @@ class LocalPersistentVolume extends Modelprotected function name(): Attribute{return Attribute::make(- set: fn (string $value) => Str::of($value)->trim()->value,+ set: fn (string $value) => str($value)->trim()->value,);}protected function mountPath(): Attribute{return Attribute::make(- set: fn (string $value) => Str::of($value)->trim()->start('/')->value+ set: fn (string $value) => str($value)->trim()->start('/')->value);}@@ -49,7 +48,7 @@ class LocalPersistentVolume extends Modelreturn Attribute::make(set: function (?string $value) {if ($value) {- return Str::of($value)->trim()->start('/')->value;+ return str($value)->trim()->start('/')->value;} else {return $value;}diff --git a/app/Models/Server.php b/app/Models/Server.phpindex 7a99940fd3..29eedd59f0 100644--- a/app/Models/Server.php+++ b/app/Models/Server.php@@ -11,7 +11,6 @@ use Illuminate\Support\Collection;use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Process;use Illuminate\Support\Facades\Storage;-use Illuminate\Support\Str;use Illuminate\Support\Stringable;use Spatie\SchemalessAttributes\Casts\SchemalessAttributes;use Spatie\SchemalessAttributes\SchemalessAttributesTrait;@@ -29,10 +28,10 @@ class Server extends BaseModelstatic::saving(function ($server) {$payload = [];if ($server->user) {- $payload['user'] = Str::of($server->user)->trim();+ $payload['user'] = str($server->user)->trim();}if ($server->ip) {- $payload['ip'] = Str::of($server->ip)->trim();+ $payload['ip'] = str($server->ip)->trim();}$server->forceFill($payload);});@@ -875,7 +874,7 @@ $schema://$host {$releaseLines = collect(explode("\n", $os_release));$collectedData = collect([]);foreach ($releaseLines as $line) {- $item = Str::of($line)->trim();+ $item = str($line)->trim();$collectedData->put($item->before('=')->value(), $item->after('=')->lower()->replace('"', '')->value());}$ID = data_get($collectedData, 'ID');diff --git a/app/Notifications/Application/DeploymentFailed.php b/app/Notifications/Application/DeploymentFailed.phpindex 1858f31e0b..a95629087b 100644--- a/app/Notifications/Application/DeploymentFailed.php+++ b/app/Notifications/Application/DeploymentFailed.php@@ -8,7 +8,6 @@ use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Notifications\Messages\MailMessage;use Illuminate\Notifications\Notification;-use Illuminate\Support\Str;class DeploymentFailed extends Notification implements ShouldQueue{@@ -41,8 +40,8 @@ class DeploymentFailed extends Notification implements ShouldQueue$this->project_uuid = data_get($application, 'environment.project.uuid');$this->environment_name = data_get($application, 'environment.name');$this->fqdn = data_get($application, 'fqdn');- if (Str::of($this->fqdn)->explode(',')->count() > 1) {- $this->fqdn = Str::of($this->fqdn)->explode(',')->first();+ if (str($this->fqdn)->explode(',')->count() > 1) {+ $this->fqdn = str($this->fqdn)->explode(',')->first();}$this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";}diff --git a/app/Notifications/Application/DeploymentSuccess.php b/app/Notifications/Application/DeploymentSuccess.phpindex 0cac6cbab3..c06d070d83 100644--- a/app/Notifications/Application/DeploymentSuccess.php+++ b/app/Notifications/Application/DeploymentSuccess.php@@ -8,7 +8,6 @@ use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Notifications\Messages\MailMessage;use Illuminate\Notifications\Notification;-use Illuminate\Support\Str;class DeploymentSuccess extends Notification implements ShouldQueue{@@ -41,8 +40,8 @@ class DeploymentSuccess extends Notification implements ShouldQueue$this->project_uuid = data_get($application, 'environment.project.uuid');$this->environment_name = data_get($application, 'environment.name');$this->fqdn = data_get($application, 'fqdn');- if (Str::of($this->fqdn)->explode(',')->count() > 1) {- $this->fqdn = Str::of($this->fqdn)->explode(',')->first();+ if (str($this->fqdn)->explode(',')->count() > 1) {+ $this->fqdn = str($this->fqdn)->explode(',')->first();}$this->deployment_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->application->uuid}/deployment/{$this->deployment_uuid}";}diff --git a/app/Notifications/Application/StatusChanged.php b/app/Notifications/Application/StatusChanged.phpindex baf508895c..72442fcb32 100644--- a/app/Notifications/Application/StatusChanged.php+++ b/app/Notifications/Application/StatusChanged.php@@ -7,7 +7,6 @@ use Illuminate\Bus\Queueable;use Illuminate\Contracts\Queue\ShouldQueue;use Illuminate\Notifications\Messages\MailMessage;use Illuminate\Notifications\Notification;-use Illuminate\Support\Str;class StatusChanged extends Notification implements ShouldQueue{@@ -31,8 +30,8 @@ class StatusChanged extends Notification implements ShouldQueue$this->project_uuid = data_get($resource, 'environment.project.uuid');$this->environment_name = data_get($resource, 'environment.name');$this->fqdn = data_get($resource, 'fqdn', null);- if (Str::of($this->fqdn)->explode(',')->count() > 1) {- $this->fqdn = Str::of($this->fqdn)->explode(',')->first();+ if (str($this->fqdn)->explode(',')->count() > 1) {+ $this->fqdn = str($this->fqdn)->explode(',')->first();}$this->resource_url = base_url()."/project/{$this->project_uuid}/".urlencode($this->environment_name)."/application/{$this->resource->uuid}";}diff --git a/app/Traits/ExecuteRemoteCommand.php b/app/Traits/ExecuteRemoteCommand.phpindex 0c6422f0cb..9b58882eb1 100644--- a/app/Traits/ExecuteRemoteCommand.php+++ b/app/Traits/ExecuteRemoteCommand.php@@ -7,7 +7,6 @@ use App\Models\Server;use Carbon\Carbon;use Illuminate\Support\Collection;use Illuminate\Support\Facades\Process;-use Illuminate\Support\Str;trait ExecuteRemoteCommand{@@ -45,7 +44,7 @@ trait ExecuteRemoteCommand}$remote_command = generateSshCommand($this->server, $command);$process = Process::timeout(3600)->idleTimeout(3600)->start($remote_command, function (string $type, string $output) use ($command, $hidden, $customType, $append) {- $output = Str::of($output)->trim();+ $output = str($output)->trim();if ($output->startsWith('╔')) {$output = "\n".$output;}diff --git a/app/View/Components/Services/Links.php b/app/View/Components/Services/Links.phpindex 9baf0578dd..0497aebae2 100644--- a/app/View/Components/Services/Links.php+++ b/app/View/Components/Services/Links.php@@ -6,7 +6,6 @@ use App\Models\Service;use Closure;use Illuminate\Contracts\View\View;use Illuminate\Support\Collection;-use Illuminate\Support\Str;use Illuminate\View\Component;class Links extends Component@@ -26,16 +25,16 @@ class Links extends Component$this->links = $this->links->merge($links);} else {if ($application->fqdn) {- $fqdns = collect(Str::of($application->fqdn)->explode(','));+ $fqdns = collect(str($application->fqdn)->explode(','));$fqdns->map(function ($fqdn) {$this->links->push(getFqdnWithoutPort($fqdn));});}if ($application->ports) {- $portsCollection = collect(Str::of($application->ports)->explode(','));+ $portsCollection = collect(str($application->ports)->explode(','));$portsCollection->map(function ($port) {- if (Str::of($port)->contains(':')) {- $hostPort = Str::of($port)->before(':');+ if (str($port)->contains(':')) {+ $hostPort = str($port)->before(':');} else {$hostPort = $port;}diff --git a/bootstrap/helpers/docker.php b/bootstrap/helpers/docker.phpindex 06416db24f..21e946a9a7 100644--- a/bootstrap/helpers/docker.php+++ b/bootstrap/helpers/docker.php@@ -91,7 +91,7 @@ function format_docker_envs_to_json($rawOutput)}function checkMinimumDockerEngineVersion($dockerVersion){- $majorDockerVersion = Str::of($dockerVersion)->before('.')->value();+ $majorDockerVersion = str($dockerVersion)->before('.')->value();if ($majorDockerVersion <= 22) {$dockerVersion = null;}@@ -152,7 +152,7 @@ function get_port_from_dockerfile($dockerfile): ?int$dockerfile_array = explode("\n", $dockerfile);$found_exposed_port = null;foreach ($dockerfile_array as $line) {- $line_str = Str::of($line)->trim();+ $line_str = str($line)->trim();if ($line_str->startsWith('EXPOSE')) {$found_exposed_port = $line_str->replace('EXPOSE', '')->trim();break;@@ -534,7 +534,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview$labels = collect([]);if ($pull_request_id === 0) {if ($application->fqdn) {- $domains = Str::of(data_get($application, 'fqdn'))->explode(',');+ $domains = str(data_get($application, 'fqdn'))->explode(',');$labels = $labels->merge(fqdnLabelsForTraefik(uuid: $appUuid,domains: $domains,@@ -558,7 +558,7 @@ function generateLabelsApplication(Application $application, ?ApplicationPreview}} else {if (data_get($preview, 'fqdn')) {- $domains = Str::of(data_get($preview, 'fqdn'))->explode(',');+ $domains = str(data_get($preview, 'fqdn'))->explode(',');} else {$domains = collect([]);}diff --git a/bootstrap/helpers/github.php b/bootstrap/helpers/github.phpindex d916dc9c85..98e405c749 100644--- a/bootstrap/helpers/github.php+++ b/bootstrap/helpers/github.php@@ -85,7 +85,7 @@ function githubApi(GithubApp|GitlabApp|null $source, string $endpoint, string $mfunction get_installation_path(GithubApp $source){$github = GithubApp::where('uuid', $source->uuid)->first();- $name = Str::of(Str::kebab($github->name));+ $name = str(Str::kebab($github->name));$installation_path = $github->html_url === 'https://github.com' ? 'apps' : 'github-apps';return "$github->html_url/$installation_path/$name/installations/new";@@ -93,7 +93,7 @@ function get_installation_path(GithubApp $source)function get_permissions_path(GithubApp $source){$github = GithubApp::where('uuid', $source->uuid)->first();- $name = Str::of(Str::kebab($github->name));+ $name = str(Str::kebab($github->name));return "$github->html_url/settings/apps/$name/permissions";}diff --git a/bootstrap/helpers/services.php b/bootstrap/helpers/services.phpindex 0cc4c51e7f..ad2268a8ed 100644--- a/bootstrap/helpers/services.php+++ b/bootstrap/helpers/services.php@@ -4,7 +4,6 @@ use App\Models\Application;use App\Models\EnvironmentVariable;use App\Models\ServiceApplication;use App\Models\ServiceDatabase;-use Illuminate\Support\Str;use Spatie\Url\Url;use Symfony\Component\Yaml\Yaml;@@ -38,7 +37,7 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Appli]);instant_remote_process($commands, $server);foreach ($fileVolumes as $fileVolume) {- $path = Str::of(data_get($fileVolume, 'fs_path'));+ $path = str(data_get($fileVolume, 'fs_path'));$content = data_get($fileVolume, 'content');if ($path->startsWith('.')) {$path = $path->after('.');@@ -68,7 +67,7 @@ function getFilesystemVolumesFromServer(ServiceApplication|ServiceDatabase|Appli$fileVolume->is_directory = false;$fileVolume->save();$content = base64_encode($content);- $dir = Str::of($fileLocation)->dirname();+ $dir = str($fileLocation)->dirname();instant_remote_process(["mkdir -p $dir","echo '$content' | base64 -d | tee $fileLocation",@@ -106,7 +105,7 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)$resourceFqdns = str($resource->fqdn)->explode(',');if ($resourceFqdns->count() === 1) {$resourceFqdns = $resourceFqdns->first();- $variableName = 'SERVICE_FQDN_'.Str::of($resource->name)->upper()->replace('-', '');+ $variableName = 'SERVICE_FQDN_'.str($resource->name)->upper()->replace('-', '');$generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();$fqdn = Url::fromString($resourceFqdns);$port = $fqdn->getPort();@@ -125,14 +124,14 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)$generatedEnv->save();}}- $variableName = 'SERVICE_URL_'.Str::of($resource->name)->upper()->replace('-', '');+ $variableName = 'SERVICE_URL_'.str($resource->name)->upper()->replace('-', '');$generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();$url = Url::fromString($fqdn);$port = $url->getPort();$path = $url->getPath();$url = $url->getHost();if ($generatedEnv) {- $url = Str::of($fqdn)->after('://');+ $url = str($fqdn)->after('://');$generatedEnv->value = $url.$path;$generatedEnv->save();}@@ -175,7 +174,7 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)$port_env_url->save();}} else {- $variableName = 'SERVICE_FQDN_'.Str::of($resource->name)->upper()->replace('-', '');+ $variableName = 'SERVICE_FQDN_'.str($resource->name)->upper()->replace('-', '');$generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();$fqdn = Url::fromString($fqdn);$fqdn = $fqdn->getScheme().'://'.$fqdn->getHost().$fqdn->getPath();@@ -183,12 +182,12 @@ function updateCompose(ServiceApplication|ServiceDatabase $resource)$generatedEnv->value = $fqdn;$generatedEnv->save();}- $variableName = 'SERVICE_URL_'.Str::of($resource->name)->upper()->replace('-', '');+ $variableName = 'SERVICE_URL_'.str($resource->name)->upper()->replace('-', '');$generatedEnv = EnvironmentVariable::where('service_id', $resource->service_id)->where('key', $variableName)->first();$url = Url::fromString($fqdn);$url = $url->getHost().$url->getPath();if ($generatedEnv) {- $url = Str::of($fqdn)->after('://');+ $url = str($fqdn)->after('://');$generatedEnv->value = $url;$generatedEnv->save();}diff --git a/resources/views/livewire/project/application/previews.blade.php b/resources/views/livewire/project/application/previews.blade.phpindex 2f142abbbd..e15aa78167 100644--- a/resources/views/livewire/project/application/previews.blade.php+++ b/resources/views/livewire/project/application/previews.blade.php@@ -68,9 +68,9 @@@foreach (data_get($application, 'previews') as $previewName => $preview)<div class="flex flex-col w-full p-4 border dark:border-coolgray-200"><div class="flex gap-2">PR #{{ data_get($preview, 'pull_request_id') }} |- @if (Str::of(data_get($preview, 'status'))->startsWith('running'))+ @if (str(data_get($preview, 'status'))->startsWith('running'))<x-status.running :status="data_get($preview, 'status')" />- @elseif(Str::of(data_get($preview, 'status'))->startsWith('restarting'))+ @elseif(str(data_get($preview, 'status'))->startsWith('restarting'))<x-status.restarting :status="data_get($preview, 'status')" />@else<x-status.stopped :status="data_get($preview, 'status')" />diff --git a/resources/views/livewire/project/database/backup-edit.blade.php b/resources/views/livewire/project/database/backup-edit.blade.phpindex 8df18cb457..462d696fa0 100644--- a/resources/views/livewire/project/database/backup-edit.blade.php+++ b/resources/views/livewire/project/database/backup-edit.blade.php@@ -4,7 +4,7 @@<x-forms.button type="submit">Save</x-forms.button>- @if (Str::of($status)->startsWith('running'))+ @if (str($status)->startsWith('running'))<livewire:project.database.backup-now :backup="$backup" />@endif@if ($backup->database_id !== 0)diff --git a/resources/views/livewire/project/service/configuration.blade.php b/resources/views/livewire/project/service/configuration.blade.phpindex 272de2f4fe..ee627c56bb 100644--- a/resources/views/livewire/project/service/configuration.blade.php+++ b/resources/views/livewire/project/service/configuration.blade.php@@ -54,11 +54,11 @@<div class="grid grid-cols-1 gap-2 pt-4 xl:grid-cols-1">@foreach ($applications as $application)<div @class([- 'border-l border-dashed border-red-500 ' => Str::of(+ 'border-l border-dashed border-red-500 ' => str($application->status)->contains(['exited']),- 'border-l border-dashed border-success' => Str::of(+ 'border-l border-dashed border-success' => str($application->status)->contains(['running']),- 'border-l border-dashed border-warning' => Str::of(+ 'border-l border-dashed border-warning' => str($application->status)->contains(['starting']),'flex gap-2 box-without-bg-without-border dark:bg-coolgray-100 bg-white dark:hover:text-neutral-300 group',])>@@ -123,12 +123,12 @@@endforeach@foreach ($databases as $database)<div @class([- 'border-l border-dashed border-red-500' => Str::of(- $database->status)->contains(['exited']),- 'border-l border-dashed border-success' => Str::of(- $database->status)->contains(['running']),- 'border-l border-dashed border-warning' => Str::of(- $database->status)->contains(['restarting']),+ 'border-l border-dashed border-red-500' => str($database->status)->contains(+ ['exited']),+ 'border-l border-dashed border-success' => str($database->status)->contains(+ ['running']),+ 'border-l border-dashed border-warning' => str($database->status)->contains(+ ['restarting']),'flex gap-2 box-without-bg-without-border dark:bg-coolgray-100 bg-white dark:hover:text-neutral-300 group',])><div class="flex flex-row w-full">