PHPackages                             ifresh/package-health - 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. ifresh/package-health

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

ifresh/package-health
=====================

Sends updatable packages to the mothership

1.2.0(2mo ago)0534↑513.3%MITPHPPHP ^8.1

Since Jan 19Pushed 2mo agoCompare

[ Source](https://github.com/iFreshDevelopment/package-health)[ Packagist](https://packagist.org/packages/ifresh/package-health)[ RSS](/packages/ifresh-package-health/feed)WikiDiscussions main Synced today

READMEChangelog (9)Dependencies (17)Versions (9)Used By (0)

iFresh Package Health
=====================

[](#ifresh-package-health)

A small Laravel package that periodically generates a health/status report for your application or packages and sends it to a remote endpoint.

The package exposes an Artisan command that:

- Decides **whether** a report should be sent (via a configurable decider class)
- Generates a report payload
- Sends the payload to a configured API endpoint
- Fails gracefully when the endpoint is unreachable

---

Features
--------

[](#features)

- 🩺 Centralized health/status reporting
- 🔌 Pluggable decision logic to control when data is sent
- 📦 Customizable report generation
- 🔐 Token-based authentication
- 🧯 Graceful handling of connection failures

---

Requirements
------------

[](#requirements)

- PHP 8.0+
- Laravel 9.x or higher

---

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

[](#installation)

Install the package via Composer:

```
composer require ifresh/package-health
```

Publish the configuration file:

```
php artisan vendor:publish --tag=package-health-config
```

---

Configuration
-------------

[](#configuration)

The package is configured via `config/health.php`.

### Available options

[](#available-options)

```
return [
    // The URL where health reports will be posted
    'url' => env('HEALTH_ENDPOINT_URL'),

    // API token used for authenticating requests
    'api_token' => env('HEALTH_API_TOKEN'),

    // Class responsible for deciding whether a report should be sent
    'decider' => \IFresh\PackageHealth\Deciders\DefaultDecider::class,
];
```

### Environment variables

[](#environment-variables)

```
HEALTH_ENDPOINT_URL=https://example.com/api/health
HEALTH_API_TOKEN=your-api-token
```

---

Artisan Command
---------------

[](#artisan-command)

The package registers the following command:

```
php artisan health:send-package-status
```

### What the command does

[](#what-the-command-does)

1. Resolves the configured **decider** and calls `shouldPost()`
2. Stops immediately if the decider returns `false`
3. Generates a report using `ReportGenerator`
4. Sends the report as JSON to the configured endpoint
5. Logs a warning if the request fails due to a connection error

---

Decision Logic (Decider)
------------------------

[](#decision-logic-decider)

The decider determines **if and when** the health report should be sent.

A decider class must implement a `shouldPost(): bool` method.

Example:

```
class DefaultDecider
{
    public function shouldPost(): bool
    {
        return app()->environment('production');
    }
}
```

This allows you to:

- Limit reports to production
- Send reports on a schedule
- Implement rate limiting or time-based logic

---

Report Generation
-----------------

[](#report-generation)

Reports are generated by:

```
IFresh\PackageHealth\Generators\ReportGenerator
```

You can extend or replace this class to customize the payload structure or contents.

---

Error Handling &amp; Logging
----------------------------

[](#error-handling--logging)

If the endpoint cannot be reached, the package:

- Catches `Illuminate\Http\Client\ConnectionException`
- Logs a warning with the request URL and error message
- Does **not** throw or fail the command

This ensures your scheduled jobs remain stable.

---

Scheduling
----------

[](#scheduling)

You can run the command automatically using Laravel's scheduler:

```
$schedule->command('health:send-package-status')->hourly();
```

---

Security
--------

[](#security)

- Requests are authenticated using a Bearer token
- Payloads are sent as JSON
- Ensure the endpoint is served over HTTPS

---

License
-------

[](#license)

This package is proprietary and maintained by **iFresh Workspace**.

---

Support
-------

[](#support)

For questions or issues, contact:

- **Email:**
- **Organization:** iFresh Workspace

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance86

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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 ~13 days

Recently: every ~23 days

Total

8

Last Release

70d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/86951752?v=4)[Stephan Bouman](/maintainers/sbouman)[@sbouman](https://github.com/sbouman)

---

Top Contributors

[![stephanbouman](https://avatars.githubusercontent.com/u/67788644?v=4)](https://github.com/stephanbouman "stephanbouman (11 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ifresh-package-health/health.svg)

```
[![Health](https://phpackages.com/badges/ifresh-package-health/health.svg)](https://phpackages.com/packages/ifresh-package-health)
```

###  Alternatives

[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[nativephp/mobile

NativePHP for Mobile

1.1k75.1k91](/packages/nativephp-mobile)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)[oat-sa/tao-core

TAO core extension

66143.7k122](/packages/oat-sa-tao-core)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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