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.1.4(1mo ago)0182↓50%MITPHPPHP ^8.1

Since Jan 19Pushed 3mo 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 1mo ago

READMEChangelog (6)Dependencies (12)Versions (7)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

40

—

FairBetter than 88% of packages

Maintenance83

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Total

6

Last Release

52d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a5745f0b6de488e95032a4a7023a50e3020be4e17f79160d53651926465b569c?d=identicon)[sbouman](/maintainers/sbouman)

---

Top Contributors

[![stephanbouman](https://avatars.githubusercontent.com/u/67788644?v=4)](https://github.com/stephanbouman "stephanbouman (7 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

[maestroerror/laragent

Power of AI Agents in your Laravel project

630106.4k](/packages/maestroerror-laragent)[nativephp/mobile

NativePHP for Mobile

82724.0k43](/packages/nativephp-mobile)[bensampo/laravel-embed

Painless responsive embeds for videos, slideshows and more.

142146.8k](/packages/bensampo-laravel-embed)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[spatie/laravel-rdap

Perform RDAP queries in a Laravel app

72108.3k2](/packages/spatie-laravel-rdap)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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