Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Commands/NewApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class NewApplication extends BaseCommand
use WatchesDeployments;

protected $signature = 'new
{--starter-kit= : Starter kit (laravel, laravel-react, laravel-vue, laravel-livewire, laravel-svelte, nextjs, nuxt, express, go, django, fastapi, rails, astro)}
{--starter-kit= : Starter kit (laravel, laravel-react, laravel-vue, laravel-livewire, laravel-svelte, laravel-rust, laravel-go, nextjs, nuxt, express, go, django, fastapi, rails, astro)}
{--repository= : New GitHub repository to create (owner/name). Must not exist yet}
{--name= : Application name. Default: the repository name}
{--region= : Region. Default: most-used or us-east-2}
Expand Down
3 changes: 3 additions & 0 deletions app/Dto/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function __construct(
public readonly array $deploymentIds = [],
public readonly ?string $repositoryFullName = null,
public readonly ?string $repositoryBranch = null,
/** `github`, `gitlab`, `gitlab_self_hosted` or `bitbucket`; null without a connected repository. */
public readonly ?string $sourceControlProviderType = null,
public readonly ?string $slackChannel = null,
public readonly ?string $avatarUrl = null,
public readonly ?string $rootDirectory = null,
Expand Down Expand Up @@ -52,6 +54,7 @@ public static function createFromResponse(array $response): self
'name' => $attributes['name'],
'slug' => $attributes['slug'],
'region' => $attributes['region'],
'sourceControlProviderType' => $attributes['source_control_provider_type'] ?? null,
'slackChannel' => $attributes['slack_channel'] ?? null,
'avatarUrl' => $attributes['avatar_url'] ?? null,
'rootDirectory' => $attributes['root_directory'] ?? null,
Expand Down
4 changes: 4 additions & 0 deletions app/Enums/StarterKit.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ enum StarterKit: string
case LARAVEL_VUE = 'laravel-vue';
case LARAVEL_LIVEWIRE = 'laravel-livewire';
case LARAVEL_SVELTE = 'laravel-svelte';
case LARAVEL_RUST = 'laravel-rust';
case LARAVEL_GO = 'laravel-go';
case NEXTJS = 'nextjs';
case NUXT = 'nuxt';
case EXPRESS = 'express';
Expand All @@ -29,6 +31,8 @@ public function label(): string
self::LARAVEL_VUE => 'Laravel + Vue',
self::LARAVEL_LIVEWIRE => 'Laravel + Livewire',
self::LARAVEL_SVELTE => 'Laravel + Svelte',
self::LARAVEL_RUST => 'Laravel (Rust)',
self::LARAVEL_GO => 'Laravel (Go)',
self::NEXTJS => 'Next.js',
self::NUXT => 'Nuxt',
self::EXPRESS => 'Express',
Expand Down
27 changes: 27 additions & 0 deletions tests/Feature/ApplicationCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Client\Resources\Meta\ListRegionsRequest;
use App\ConfigRepository;
use App\Git;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Sleep;
use Laravel\Prompts\Prompt;
use Saloon\Http\Faking\MockClient;
Expand All @@ -30,6 +31,32 @@
MockClient::destroyGlobal();
});

// ---- application:get ----

it('exposes the source control provider, and null without a repository', function (array $attributes, ?string $expected) {
MockClient::global([
GetOrganizationRequest::class => MockResponse::make(organizationResponse(), 200),
GetApplicationRequest::class => MockResponse::make([
'data' => createApplicationResponse(['attributes' => $attributes]),
'included' => [
['id' => 'org-1', 'type' => 'organizations', 'attributes' => ['name' => 'My Org', 'slug' => 'my-org']],
],
], 200),
]);

Artisan::call('application:get', [
'application' => 'app-123',
'--json' => true,
'--fields' => 'sourceControlProviderType',
'--no-interaction' => true,
]);

expect(json_decode(Artisan::output(), true))->toBe(['sourceControlProviderType' => $expected]);
})->with([
'gitlab' => [['source_control_provider_type' => 'gitlab'], 'gitlab'],
'no repository' => [['repository' => null, 'source_control_provider_type' => null], null],
]);

// ---- application:list ----

it('lists applications successfully in interactive mode', function () {
Expand Down
5 changes: 5 additions & 0 deletions tests/Feature/NewApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ function runNew(array $options = []): int
->and($this->sent)->toBe(['create-application']);
});

it('creates an application from the Rust and Go starter kits', function (string $kit) {
expect(runNew(['--starter-kit' => $kit, '--database' => 'none']))->toBe(0)
->and($this->sentBody['starter_kit'])->toBe($kit);
})->with(['laravel-rust', 'laravel-go']);

it('skips the database for kits outside Laravel', function () {
runNew(['--starter-kit' => 'nextjs']);

Expand Down