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
/** | |
* Get the portion of a string between two given strings. | |
* | |
* @param string $subject | |
* @param string $start | |
* @param string $end | |
* @param bool $insensitive | |
* @param bool $innerOnly | |
* @param bool $inverse | |
* |
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
implode(array, key = null, glue = ', ') { | |
if(key) { | |
array = array.map(function(element) { | |
return element[key]; | |
}) | |
} | |
return array.join(glue); | |
}, |
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
public static function mergeJson($to, $from, $matchBy, $key) | |
{ | |
$to = json_decode(file_get_contents(storage_path($to))); | |
$from = json_decode(file_get_contents(storage_path($from))); | |
$values = []; | |
foreach($from as $object) { | |
$values[$object->{$matchBy}] = $object->{$key}; | |
} |
NewerOlder