PHPackages                             spresnac/laravel-tactical-time-helper - 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. spresnac/laravel-tactical-time-helper

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

spresnac/laravel-tactical-time-helper
=====================================

Need some helper regarding tactical times in laravel? I needed some helper for handling incoming tactime and sending tactime strings from my project, so here it is to help you.

1.0.0(2y ago)08MITPHPPHP ^8.3CI failing

Since May 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/spresnac/laravel-tactical-time-helper)[ Packagist](https://packagist.org/packages/spresnac/laravel-tactical-time-helper)[ Docs](https://github.com/spresnac/laravel-tactical-time-helper)[ GitHub Sponsors](https://github.com/sponsors/spresnac)[ Fund](https://www.paypal.me/paladin)[ RSS](/packages/spresnac-laravel-tactical-time-helper/feed)WikiDiscussions main Synced 2d ago

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

laravel-tactical-time-helper
============================

[](#laravel-tactical-time-helper)

About
-----

[](#about)

This helper package provides you some aiding when it comes to deal with tactical times on your input and output side. I do need this package in my Red-Cross related projects, so they are already battle-tested 🫡.

It is not feature-complete so you are welcome to add your code 🙏

---

Install
-------

[](#install)

First things first, you install this package with

```
composer install spresnac/laravel-tactical-time-helper --no-dev
```

---

Usage
-----

[](#usage)

This package contains 2 parts to help you with your times.

### Form request rules

[](#form-request-rules)

The form request rules provide some guiding about handling incoming form fields where tactical data should be provided by the user. Therefor you can use the `TacticalTime` class in the `Rules` directory. An example; in your requests class, you can write it like so:

```
class CreateEntryRequest extends FormRequest
{
    //...

    public function rules(): array
    {
        return [
            'situation' => 'required|string',
            'tactime' => [
                new \spresnac\tacticaltimehelper\Rules\TacticalTime(),
            ],
            //...
        ];
    }
}
```

By default, the `TacticalTime` rule wants to have the input like `082145may2024` while it ignores the cases. It ignores the case to prevent beeing to strict (there are humans on the other side and mostly, this humans do not have much time when it comes to tactical time inputs) and on the other side the case is not relevant when it comes to converting the input to the real time you store in your database (or whereever); in short: Carbon can handle it, no matter the case 😉

---

### Repository Helper

[](#repository-helper)

The `TacticalTimeRepository` provides you 2 static helper functions

#### `public static function toTacticalTime(Carbon $time): string`

[](#public-static-function-totacticaltimecarbon-time-string)

This function takes a `Carbon` input and converts it to the corresponding tactical time. Using Carbon is pretty neat in laravel projects because most of your date-related things are (or should be) in Carbon (like `created_at` or `updated_at` or in my case a `situation_at`).
In short: As long as your input is `Carbon` you are good to go.

#### public static function fromTacticalTime(string $tactime): Carbon

[](#public-static-function-fromtacticaltimestring-tactime-carbon)

This function takes a string and converts it to it's corresponding `Carbon` object (so you can easily store it into databases or whereever you persist your data).
The input MUST be like `082145may2024`, so 2 digits for the day, 2 digits for the hour, 2 digits for the minutes, the month as 3-letter-short and the year with 4 digits.
The result is a `Carbon` object to work further with.

---

Test
----

[](#test)

You can test this package by installing it with all dependencies

```
composer install spresnac/laravel-tactical-time-helper
```

and then run

```
vendor\bin\phpunit
```

(depending on your OS you have to add .\\ in front of the line)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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

Unknown

Total

1

Last Release

786d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/04d0510a1a5bdd5707fb726d639d971007e602343c4378f65a56c64fa5638170?d=identicon)[spresnac](/maintainers/spresnac)

---

Top Contributors

[![spresnac](https://avatars.githubusercontent.com/u/3299107?v=4)](https://github.com/spresnac "spresnac (3 commits)")

---

Tags

phplaravelhelpertimetactical

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/spresnac-laravel-tactical-time-helper/health.svg)

```
[![Health](https://phpackages.com/badges/spresnac-laravel-tactical-time-helper/health.svg)](https://phpackages.com/packages/spresnac-laravel-tactical-time-helper)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.2k95.4M306](/packages/laravel-horizon)[illuminate/support

The Illuminate Support package.

630113.0M41.4k](/packages/illuminate-support)[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)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40146.5k2](/packages/erlandmuchasaj-laravel-gzip)[mindtwo/native-enum

Package for using native php enums.

2630.2k1](/packages/mindtwo-native-enum)

PHPackages © 2026

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