crumbls/astrology

Internal Laravel package: natal chart engine (tropical + Vedic) with interactive D3 renderer, built on Swiss Ephemeris.

Maintainers

Package info

github.com/Crumbls/Astrology

pkg:composer/crumbls/astrology

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-05-04 07:05 UTC

This package is auto-updated.

Last update: 2026-05-15 14:36:01 UTC


README

Internal Laravel package: natal chart engine (tropical Western + sidereal Vedic) with an interactive D3 chart renderer. Built on Swiss Ephemeris via jayeshmepani/swiss-ephemeris-ffi. Verified against Cafe Astrology and swetest to the arcsecond.

Install

composer require crumbls/astrology
php artisan swisseph:install

swisseph:install downloads the three required .se1 data files and builds the swetest binary (macOS or Linux). It's idempotent — re-running with no --force only fetches what's missing.

Then enable PHP FFI in your environment:

  • Herd / Valet: open Herd → PHP → INI tab → add ffi.enable=true → save (auto-restarts FPM).
  • CLI works without changes (CLI defaults to ffi.enable=preload which still permits FFI from CLI).

Usage

use Crumbls\Astrology\Services\NatalChartService;

$svc = app(NatalChartService::class);
$birth = new DateTimeImmutable('1984-04-19 05:00:00', new DateTimeZone('UTC'));

$chart = $svc->chart($birth, latitude: 38.31667, longitude: -107.78333);
// Returns: birth, mode, ayanamsa, ascendant, midheaven, vertex,
//          part_of_fortune, planets, houses, placidus_cusps, aspects.

For a Vedic chart (with nakshatras, padas, Vimshottari dashas):

$chart = $svc->chart($birth, 38.31667, -107.78333, NatalChartService::MODE_SIDEREAL);

Demo page

Visit /astro/chart for an interactive D3 chart wheel with hover tooltips, aspect line highlighting, and a form to compute new charts. Disable with ASTROLOGY_DEMO_ROUTE=false.

CLI

php artisan astro:chart "1984-04-19 05:00:00" --lat=38.31667 --lng=-107.78333 --tz=UTC
php artisan astro:chart "1990-05-15 14:30:00" --lat=40.7128 --lng=-74.0060 --json

Caching

Chart results are cached via Cache::rememberForever() keyed on (UTC timestamp, lat, lng, mode). First call ~2ms; subsequent reads ~0.2ms. Use ASTROLOGY_CACHE_STORE=redis (or any cache store name) to override the default store.

Roadmap

  • SynastryService — cross-aspects between two charts
  • CompositeService — midpoint composite charts
  • AshtakootaService — Vedic Guna Milan (36-point matrimonial compatibility)
  • Pluggable interpretation-content store