PHPackages                             deepskylog/laravel-astronomy-library - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. deepskylog/laravel-astronomy-library

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

deepskylog/laravel-astronomy-library
====================================

A library to execute astronomical calculations

v6.7.5(5mo ago)125473GPL-3.0-or-laterPHPPHP &gt;=8.0

Since Apr 18Pushed 5mo ago2 watchersCompare

[ Source](https://github.com/DeepskyLog/laravel-astronomy-library)[ Packagist](https://packagist.org/packages/deepskylog/laravel-astronomy-library)[ Docs](https://github.com/DeepskyLog/laravel-astronomylibrary)[ GitHub Sponsors](https://github.com/WimDeMeester)[ RSS](/packages/deepskylog-laravel-astronomy-library/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (76)Used By (0)

laravel-astronomy-library
=========================

[](#laravel-astronomy-library)

[![Logo](public/img/laravel-astronomy-library.png)](public/img/laravel-astronomy-library.png)

[![Logo](public/img/logo2.png)](https://www.deepskylog.org/)

[![Latest Version on Packagist](https://camo.githubusercontent.com/df56795c7a6505a4d58cfb3eee13471b4039793e2da099c2c3ed78b80e2df1b8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64656570736b796c6f672f6c61726176656c2d617374726f6e6f6d792d6c6962726172792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deepskylog/laravel-astronomy-library)[![Total Downloads](https://camo.githubusercontent.com/9f38b174f14d50f04f18ceefa663c38badd9f212fb07caaa2415034d94f918c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64656570736b796c6f672f6c61726176656c2d617374726f6e6f6d792d6c6962726172792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/deepskylog/laravel-astronomy-library)[![Build Status](https://camo.githubusercontent.com/32933595b048d83599d0ad860b1f6dce69ba73f0ec02dcadfb1557b5368dce07/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f64656570736b796c6f672f6c61726176656c2d617374726f6e6f6d792d6c6962726172792f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/deepskylog/laravel-astronomy-library)[![StyleCI](https://camo.githubusercontent.com/e40ce62656519452be52e2b2e52c0caa6ff125679f1339cdaa7f2f6d8608faf2/68747470733a2f2f7374796c6563692e696f2f7265706f732f3235353535303439392f736869656c64)](https://styleci.io/repos/255550499)

Take a look at [contributing.md](contributing.md) if you are interesting in helping out. The laravel-astronomy-library is part of [DeepskyLog](https://www.deepskylog.org). If you are interested in helping with the development of DeepskyLog, see the [documentation](https://github.com/DeepskyLog/DeepskyLog/blob/laravel/README.md).

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

[](#installation)

AstronomyLibrary can be installed via composer. laravel-astronomy-library needs at least php 7.4 to run.

```
composer require deepskylog/laravel-astronomy-library
```

You need to publish and run the migration:

```
php artisan vendor:publish --provider="deepskylog\AstronomyLibrary\AstronomyLibraryServiceProvider" --tag="migrations"
php artisan migrate
```

### Applying migrations (package users)

[](#applying-migrations-package-users)

When installing the package you need to publish the package migration stubs into your application and run your migrations.

- Fresh install (no existing `comets_orbital_elements` table):

```
php artisan vendor:publish --provider="deepskylog\AstronomyLibrary\AstronomyLibraryServiceProvider" --tag="migrations"
php artisan migrate
```

- Existing install (table already present):

1. Publish the package migrations (this copies an ALTER migration stub into your app):

```
php artisan vendor:publish --provider="deepskylog\AstronomyLibrary\AstronomyLibraryServiceProvider" --tag="migrations"
```

1. Run your migrations. The published ALTER migration will add the optional photometry columns (`H`, `n`, `phase_coeff`, `n_pre`, `n_post`) if they don't already exist:

```
php artisan migrate
```

Note: the package includes both a create-table stub (for new installs) and a safe ALTER stub (for existing installs); publishing then migrating is the recommended flow in both cases.

The database table with the delta t values can be updated using the following command:

```
php artisan astronomy:updateDeltat
```

A job is automatically scheduled every 4 months to update the delta t value.

The database tables with the orbital elements of the comets and the asteroids can be updated using the followong command:

```
php artisan astronomy:updateOrbitalElements
```

A job is automatically scheduled every Monday at 04:30 to update the orbital elements of the comets and the asteroids.

These jobs can be executed using:

```
php artisan schedule:run
```

It is possible to run these jobs automatically by adding the following line to your crontab:

```
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
```

Documentation
-------------

[](#documentation)

For more documentation on the mathematical background, see [docs.md](docs/docs.md).

Usage
-----

[](#usage)

```
