1. Go to this page and download the library: Download buglerv/laravel-helpers 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/ */
buglerv / laravel-helpers example snippets
class A
{
use \Buglerv\LaravelHelpers\Traits\ChainableMethods;
protected $count = 2;
public function sub()
{
return --$this->count;
}
public function add()
{
return ++$this->count;
}
public function echo()
{
echo $this->count;
return $this->count;
}
}
$a = new A;
// Объединения с OR
var_dump($a->subOrEcho()); // int(1)
var_dump($a->subOrEcho()); // 0 bool(false)
// Объединение с AND
var_dump($a->addAndEcho()); // 1 int(1)
var_dump($a->subAndEcho()); // bool(false)
// Так же есть ключевые слова True и False
var_dump($a->addAndFalse()); // bool(false)
var_dump($a->subOrTrue()); // bool(true)