it-brains/laravel-aurora-solar

Package for 3rd party API integration with Aurora Solar provider

1.0.0 2025-04-25 16:26 UTC

This package is auto-updated.

Last update: 2025-04-25 16:57:31 UTC


README

A Laravel wrapper for the Aurora Solar API.

This package simplifies integration with Aurora Solar's API, enabling full-featured interaction including managing solar projects, design requests, and more.

API Documentation

Installation

Install the package via Composer:

composer require it-brains/laravel-aurora-solar:^1.0

Set the required environment variables in your .env file:

AURORA_TENANT_ID=
AURORA_BEARER=

To confirm that everything is working correctly, try retrieving tenant details:

Aurora::getTenantDetails();

Usage Example

Create a project and a design request with auto-accept and SLA settings:

use Aurora\Facades\Aurora;
use Aurora\Models\Project;
use Aurora\Enums\ProjectTypeEnum;

$auroraProject = Aurora::createProject(
    Project::init()
        ->setName('The best project ever')
        ->setCustomerName('John', 'Doe')
        ->setLocation(
            '4123 Aquastone Court, Bakersfield, CA, USA, 93313',
            35.2673641,
            -119.0491066
        )
        ->setProjectType(ProjectTypeEnum::RESIDENTIAL)
        ->setExternalProviderId('Our internal unique project ID')
);

$designRequest = Aurora::createDesignRequest([
    'project_id' => $auroraProject['id'],
    'auto_accept' => true,
    'sla' => 30,
]);

$designRequestId = $designRequest['id'];

Local Development with Dummy Client

For local development and testing, you can use the built-in Dummy driver, which generates predefined DXF, assets, and other mock data.

Set the driver in your .env:

AURORA_DRIVER=dummy

There are four predefined fixtures used in random order. To force the use of a specific fixture:

AURORA_FIXTURE=2