PHP code example of rappasoft / laravel-helpers
1. Go to this page and download the library: Download rappasoft/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/ */
rappasoft / laravel-helpers example snippets
ring helpers
$slug = str_slug('Hello World'); // "hello-world"
$plural = str_plural('user', 2); // "users"
$masked = str_mask('1234567890', '*', 3, 4); // "123****890"
// Array helpers
$value = array_get($data, 'user.profile.name', 'Default');
$hasKey = array_has($data, 'user.email');
$first = array_key_first($array);
// General helpers
if (blank($value)) {
// Handle empty value
}
$result = transform($value, function ($v) {
return strtoupper($v);
}, 'default');