PHP code example of snower / phslock
1. Go to this page and download the library: Download snower/phslock 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/ */
snower / phslock example snippets
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Snower\Phslock\Laravel\Facades\Phslock;
class TestSlockEvent extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'test:slock-event';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
$event = Phslock::Event("test", 5, 120, false);
$event->set();
return 0;
}
}