PHPackages                             laravel-enso/sunrise-sunset - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. laravel-enso/sunrise-sunset

ActiveLibrary[API Development](/categories/api)

laravel-enso/sunrise-sunset
===========================

Sunrise and sunset API integration for Laravel Enso

1.0.4(1mo ago)085↓86.7%MITPHPPHP ^8.2

Since Jan 16Pushed 1mo agoCompare

[ Source](https://github.com/laravel-enso/sunrise-sunset)[ Packagist](https://packagist.org/packages/laravel-enso/sunrise-sunset)[ Docs](https://github.com/laravel-enso/sunrise-sunset)[ RSS](/packages/laravel-enso-sunrise-sunset/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

Sunrise Sunset
==============

[](#sunrise-sunset)

[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Stable](https://camo.githubusercontent.com/08b5d2bdeeb749cdbeaa1dc88f5f2275a54b38ff842f0f916170d22b5108c256/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f73756e726973652d73756e7365742f76657273696f6e)](https://packagist.org/packages/laravel-enso/sunrise-sunset)[![Downloads](https://camo.githubusercontent.com/945fa42ec316fc6db774d86f36198ba588ab08c579dd75fcc634b7db6482ef71/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d656e736f2f73756e726973652d73756e7365742f646f776e6c6f616473)](https://packagist.org/packages/laravel-enso/sunrise-sunset)[![PHP](https://camo.githubusercontent.com/da7cf113b588d26fe679dfefe4a15009272ed358ad4e786ad3c78b45faa61d69/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322532422d3737376262342e737667)](composer.json)[![Issues](https://camo.githubusercontent.com/d04c1cc24bf9005825c852b500b7557232738a7cc3d2eccdb76bce382b5b4d7b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f6c61726176656c2d656e736f2f73756e726973652d73756e7365742e737667)](https://github.com/laravel-enso/sunrise-sunset/issues)[![Merge Requests](https://camo.githubusercontent.com/720f2bde0efde051b77355521e84d60f8e9d6e4d01316a44f7c8db9a9e499d27/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732d70722f6c61726176656c2d656e736f2f73756e726973652d73756e7365742e737667)](https://github.com/laravel-enso/sunrise-sunset/pulls)

Description
-----------

[](#description)

Sunrise Sunset integrates the [sunrisesunset.io](https://sunrisesunset.io/api/) service into Laravel Enso.

The package wraps the external API behind an Enso `Action`, logs outbound calls through `laravel-enso/api`, exposes a protected application route, and stores the Enso structure required for access control.

It is intended for applications that need sunrise and sunset times for a configured location without implementing the remote call flow manually.

Installation
------------

[](#installation)

Install the package:

```
composer require laravel-enso/sunrise-sunset
```

Run the package migration:

```
php artisan migrate
```

Optional publish:

```
php artisan vendor:publish --tag=sunrise-sunset-config
```

Configure the target coordinates:

```
// config/enso/sunriseSunset.php
return [
    'latitude' => env('SUNRISE_SUNSET_LATITUDE'),
    'longitude' => env('SUNRISE_SUNSET_LONGITUDE'),
];
```

Features
--------

[](#features)

- wraps the `sunrisesunset.io` JSON endpoint through `laravel-enso/api`
- exposes an Enso route for authenticated callers
- logs outbound requests and responses through the API package
- registers a package permission for route-level access control
- keeps latitude and longitude configurable through Enso config

Usage
-----

[](#usage)

The package exposes an internal action that can be called directly:

```
use Carbon\Carbon;
use LaravelEnso\SunriseSunset\Actions\Get;

$response = (new Get(
    Carbon::parse('2026-05-01'),
    Carbon::parse('2026-05-07'),
))->handle();

$payload = $response->json();
```

The endpoint sends these query parameters to the upstream API:

- `date_start`
- `date_end`
- `lat`
- `lng`

The latitude and longitude values are resolved from:

- `config('enso.sunriseSunset.latitude')`
- `config('enso.sunriseSunset.longitude')`

API
---

[](#api)

### HTTP route

[](#http-route)

- `GET api/sunriseSunset` named `sunriseSunset.index`

The route is loaded inside the Enso middleware stack:

- `api`
- `auth`
- `core`

### Internal classes

[](#internal-classes)

- `LaravelEnso\SunriseSunset\Actions\Get`
- `LaravelEnso\SunriseSunset\Endpoints\Get`
- `LaravelEnso\SunriseSunset\Http\Controllers\Index`

Depends On
----------

[](#depends-on)

Required Enso package:

- [`laravel-enso/api`](https://docs.laravel-enso.com/backend/api.html) [↗](https://github.com/laravel-enso/api)

Related Enso packages:

- [`laravel-enso/core`](https://docs.laravel-enso.com/backend/core.html) [↗](https://github.com/laravel-enso/core)
- [`laravel-enso/migrator`](https://docs.laravel-enso.com/backend/migrator.html) [↗](https://github.com/laravel-enso/migrator)

External service dependency:

- [`sunrisesunset.io`](https://sunrisesunset.io/api/) [↗](https://sunrisesunset.io/api/)

Contributions
-------------

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance89

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~29 days

Total

5

Last Release

53d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16073274?v=4)[Adrian Ocneanu](/maintainers/aocneanu)[@aocneanu](https://github.com/aocneanu)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (3 commits)")[![tedipop16](https://avatars.githubusercontent.com/u/71398467?v=4)](https://github.com/tedipop16 "tedipop16 (3 commits)")[![vmcvlad](https://avatars.githubusercontent.com/u/37445394?v=4)](https://github.com/vmcvlad "vmcvlad (3 commits)")

---

Tags

apilaravel-ensosunrise-sunset

### Embed Badge

![Health badge](/badges/laravel-enso-sunrise-sunset/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-enso-sunrise-sunset/health.svg)](https://phpackages.com/packages/laravel-enso-sunrise-sunset)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M134](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M62](/packages/knuckleswtf-scribe)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[statamic/cms

The Statamic CMS Core Package

4.8k3.6M992](/packages/statamic-cms)[kyon147/laravel-shopify

Shopify package for Laravel to aide in app development

485302.1k](/packages/kyon147-laravel-shopify)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

74331.3k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
