hardimpactdev/orbit-core

Core functionality for orbit-web and orbit-desktop

Fund package maintenance!
Hard Impact

Installs: 92

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/hardimpactdev/orbit-core

0.0.4 2026-01-19 10:35 UTC

This package is auto-updated.

Last update: 2026-01-21 23:45:05 UTC


README

A Laravel package providing shared functionality for the Orbit ecosystem - managing local development environments powered by Orbit CLI.

Latest Version on Packagist

Overview

Orbit Core is the shared foundation for both orbit-desktop (NativePHP desktop app) and orbit-web (web dashboard). It contains:

  • Models: Environment, Project, Deployment, Setting, SshKey, TemplateFavorite, UserPreference
  • Services: OrbitCli services (ProjectService, ConfigurationService, etc.), DoctorService, SshService
  • Controllers: All HTTP controllers for the Orbit UI
  • Middleware: HandleInertiaRequests, ImplicitEnvironment, DesktopOnly
  • HTTP Integrations: Saloon connectors for Orbit API communication
  • Vue Frontend: Pages, components, layouts, stores, and composables
  • Routes: Web and API routes with mode-aware registration

Installation

composer require hardimpactdev/orbit-core

Publish Migrations

php artisan vendor:publish --tag="orbit-core-migrations"
php artisan migrate

Publish Config (optional)

php artisan vendor:publish --tag="orbit-core-config"

Usage

Register Routes

In your AppServiceProvider:

use HardImpact\Orbit\OrbitServiceProvider;

public function boot(): void
{
    OrbitServiceProvider::routes();
}

Configure Mode

In your .env:

# Web mode (single environment, flat routes)
ORBIT_MODE=web
MULTI_ENVIRONMENT_MANAGEMENT=false

# Desktop mode (multi-environment, prefixed routes)
ORBIT_MODE=desktop
MULTI_ENVIRONMENT_MANAGEMENT=true

Frontend Assets

Configure Vite to compile assets from the package:

// vite.config.ts
export default defineConfig({
    build: {
        rollupOptions: {
            input: "vendor/hardimpactdev/orbit-core/resources/js/app.ts",
        },
    },
    resolve: {
        alias: {
            "@": path.resolve(__dirname, "vendor/hardimpactdev/orbit-core/resources/js"),
        },
    },
});

Architecture

Namespace Structure

All classes use the HardImpact\Orbit namespace:

HardImpact\Orbit\
  Models\              # Eloquent models
  Services\            # Business logic
    OrbitCli\          # CLI interaction services
      Shared\          # Shared utilities
  Http\
    Controllers\       # HTTP controllers
    Middleware\        # HTTP middleware
    Integrations\      # Saloon API connectors

Mode-Aware Behavior

The package supports two modes controlled by config("orbit.multi_environment"):

Aspect Web Mode Desktop Mode
Routes Flat (/projects) Prefixed (/environments/{id}/projects)
Environment Single, implicit Multiple, explicit
Environment UI Hidden Visible

Service Pattern

Services return consistent response structures:

[
    "success" => bool,
    "data" => mixed,
    "error" => ?string,
]

Related Projects

  • Orbit Desktop - NativePHP desktop app (requires this package)
  • Orbit Web - Web dashboard (requires this package)
  • Orbit CLI - The CLI tool that powers local development

License

MIT