1. Go to this page and download the library: Download shortdark/powercable library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
shortdark / powercable example snippets
= 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
*/
$test->latestStartTime();
var_dump($test->image_message);
/*
* Calculate whether someone can order a product that takes n days
*/
$test->earliestEndTime();
var_dump($test->workdays_boolean);
use App\Http\Controllers\Controller;
use Shortdark\Powercable;
class MyController extends Controller
{
public function index(Powercable $power)
{
$power->latestStartTime();
$result = $power->image_message;
return view('index', compact('result'));
}
}
{{ json_encode($result) }}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.