Checks to see if the current time or start time/date is far enough away from an end date/time.

0.4.7 2019-04-21 17:54 UTC

This package is auto-updated.

Last update: 2024-02-22 19:09:21 UTC


Powercable tells you from the start time and end time whether a product that takes n days is able to be ordered. Also, working backwards from the end time, do we have enough time to process the order.


Install the latest version with

$ composer require shortdark/powercable

Basic Usage


require_once 'vendor/autoload.php';

$test = new Shortdark\Powercable();

$test->endtime = '1556452800'; // UNIX timestamp for the end time

 * Calculate the latest dates we can start work based on the end time

 * Calculate whether someone can order a product that takes n days

Basic Usage in a Laravel Controller


use App\Http\Controllers\Controller;
use Shortdark\Powercable;

class MyController extends Controller
    public function index(Powercable $power)
        $result = $power->image_message;
        return view('index', compact('result'));

Then, as $result is an array, to get a representation of the array you could have something like the following in the index.blade.php.

{{ json_encode($result) }}


Neil Ludlow - -