This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vitanova\Utilities; | |
use Illuminate\Contracts\Cache\Repository; | |
use Psr\Cache\CacheItemInterface, | |
Psr\Cache\CacheItemPoolInterface, | |
Psr\Cache\InvalidArgumentException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Since bash is following a Procedural execution, defining functions first is required. | |
runInstaller () | |
{ | |
ValidateAndInstallDependencies | |
valiteUserAndEnterHome | |
cloneRepoAndEnterDirectory | |
setupDatabase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_date($value): bool | |
{ | |
if ($value instanceof DateTime) { | |
return true; | |
} | |
if ((! is_string($value) && ! is_numeric($value)) || strtotime($value) === false) { | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Support; | |
use ArrayIterator; | |
use Countable; | |
use DatePeriod; | |
use DateTime; | |
use DateInterval; | |
use IteratorAggregate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { map, forEach } from 'lodash'; | |
class FileUploadQueue { | |
/** | |
* Create the upload queue | |
* | |
* @param Array | Object supported [{name:'photos', mime:'image'}] | |
* @return void | |
*/ | |
constructor (supported = []) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! function_exists('istr_contains')) { | |
/** | |
* Insensitively check if given haystack contains anything like the given needle(s). | |
* | |
* @param string $haystack | |
* @param string[] $needles | |
* @return boolean | |
*/ | |
function istr_contains($haystack, $needles = []) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Symfony\Component\Process\Process; | |
use Symfony\Component\Process\Exception\ProcessFailedException; | |
class DatabaseOptimizeCommand extends Command | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Collection; | |
/** | |
* Map the values of given collection into a collection of each pair, retaining the key. | |
* | |
* @return Collection | |
*/ | |
Collection::macro('toFlatValuePairs', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
trait HasModelStates | |
{ | |
/** | |
* The registered model states. | |
* | |
* @var array | |
*/ | |
protected $states = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Requests; | |
use function array_dot; | |
use function fnmatch; | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\Collection; | |
use Illuminate\Support\Str; |
OlderNewer