PHPackages                             tuhin18003/the-greet - 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. tuhin18003/the-greet

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

tuhin18003/the-greet
====================

Greeting based on time and with option to add name at the end of the line

v1.0.4(9mo ago)0583↓65.6%1MITPHPPHP &gt;=7.2.5CI passing

Since Jan 3Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/tuhin18003/the-greet)[ Packagist](https://packagist.org/packages/tuhin18003/the-greet)[ Docs](https://github.com/tuhin18003/the-greet)[ RSS](/packages/tuhin18003-the-greet/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (5)DependenciesVersions (6)Used By (0)

The Greet
=========

[](#the-greet)

Greeting helper based on **time of the day** with the option to include the person’s name and formatted date.

Install
-------

[](#install)

Via Composer

```
$ composer require tuhin18003/the-greet
```

Usage
-----

[](#usage)

Load via Composer autoload:

```
require './vendor/autoload.php';
```

It takes up to **2 parameters**:

1. **Name** *(string)* – The person’s name (optional, can be skipped).
2. **Date format** *(string)* – PHP date format (optional). Skip this parameter to hide today’s date.

---

### Example 1: With name and date

[](#example-1-with-name-and-date)

```
use Tuhin18003\Greet\Greet;

$Greet = new Greet();

echo $Greet->hello('Jon Doe', 'l F j, Y');
```

**Output:**

```
Good morning Jon Doe. Rise and shine! A new day brings new opportunities. Today is Tuesday January 3, 2023.

```

---

### Example 2: With name only

[](#example-2-with-name-only)

```
echo $Greet->hello('Alice');
```

**Output:**

```
Good afternoon Alice. Keep going — the best is yet to come!

```

---

### Example 3: Without name or date

[](#example-3-without-name-or-date)

```
echo $Greet->hello();
```

**Output:**

```
Good evening. Take a moment to reflect and breathe. You’ve done great.

```

---

Features
--------

[](#features)

- ⏰ **Smart time-based greetings** – Messages adapt based on the current hour (00–23).
- 👤 **Personalized greetings** – Optionally add a person’s name.
- 📅 **Custom date output** – Choose your own date format (using [PHP date formats](https://www.php.net/manual/en/function.date.php)).
- 💡 **Inspirational quotes** – Each greeting comes with a motivational line.
- 🔄 **Consistent return** – Use as a string or structured array depending on your needs.

---

Advanced Usage
--------------

[](#advanced-usage)

If you need a structured array instead of plain text, pass `$return_arr = true`.

```
$response = $Greet->hello('Jon Doe', 'l F j, Y', true);

print_r($response);
```

**Output:**

```
Array
(
    [msg] => Good night
    [name] => Jon Doe
    [quote] => Rest well — tomorrow holds endless possibilities.
    [today] => Today is Tuesday January 3, 2023
)
```

---

Output Samples
--------------

[](#output-samples)

- `Good morning Jon Doe. Rise and shine! A new day brings new opportunities. Today is Monday July 1, 2024.`
- `Good evening Alice. Take a moment to reflect and breathe. You’ve done great.`
- `Good night. Sleep well — endless possibilities await you.`

---

### Credentials

[](#credentials)

- *Created by - [M. Tuhin](https://codesolz.net/)*

[ ![codesolz.net](https://camo.githubusercontent.com/ab5e0b864cdcb589035804867cb5924d7d8985f8a0aa75a8e9a54eff4feaa5b5/68747470733a2f2f7374617469632e636f6465736f6c7a2e6e65742f63732f6c6f676f2e77656270)](https://codesolz.net)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance58

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

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

Total

5

Last Release

276d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2d3ca97c3d8c9f5c5e46763ff130c96b5b5deafc3d2c41ce78d19ad50fda3b9c?d=identicon)[tuhin18003](/maintainers/tuhin18003)

---

Top Contributors

[![tuhin18003](https://avatars.githubusercontent.com/u/3587495?v=4)](https://github.com/tuhin18003 "tuhin18003 (16 commits)")

### Embed Badge

![Health badge](/badges/tuhin18003-the-greet/health.svg)

```
[![Health](https://phpackages.com/badges/tuhin18003-the-greet/health.svg)](https://phpackages.com/packages/tuhin18003-the-greet)
```

PHPackages © 2026

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