PHP code example of propaysystems / utilities

1. Go to this page and download the library: Download propaysystems/utilities 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/ */

    

propaysystems / utilities example snippets


DatabaseHelper::resetTable($table);

DateHelper::getMonthName($number, $abbreviation = false);

DateHelper::getFiscalYear();

DateHelper::getTime($string);

FileHelper::formatBytes($bytes, $precision = 2);

HttpHelper::getIp();

HttpHelper::getUserAgent();

HttpHelper::hostname($full = false);

HttpHelper::subdomain();

IdNumberHelper::generateIdNumber($dateOfBirt, int $male = 1);

IdNumberHelper::generateFakeNumber($dateOfBirt, int $male = 1);

IdNumberHelper::getGenderCode($idNumber);

IdNumberHelper::getBirthDate($idNumber);

IdNumberHelper::getAgeFromIdNumber($idNumber);

IdNumberHelper::getAgeFromIdNumber($attribute, $value, $parameters);

NumberHelper::randomInt();

NumberHelper::getPercentageDifference(int $last, int $current);

NumberHelper::numberFormat(int $number);

NumberHelper::combineCellPrefix($prefix, $number)

RouteHelper::currentRouteContains($string);

SmsHelper::multipart_count($str);

StringHelper::initials($str, bool $upperCase = true);

StringHelper::capitaliseFirstChar($string);

StringHelper::clean($string, string $delimiter = '-', bool $toLower = false, bool $removeSpecialChars = true);

StringHelper::generatePassword($length = 15, $count = 1, $characters = 'lower_case,upper_case,numbers,special_symbols');

StringHelper::mask($string, string $maskingCharacter = '*', int $padLeft = 4, int $padRight = 4));

StringHelper::dbColumnHumanReadable($string_array);

StringHelper::dbColumnRelation($string_array);

StringHelper::specialCharacters();

use ActivityHelper;

$thia->log(string $channel, string $description, $preformedOn = null, $causedBy = null, array $properties = []);

use AlertHelper;

$this->alert($title, $text...);
$this->alertUpdated();
$this->alertCreated();
$this->alertDeleted();
etc

use DropdownSchema;

$this->table('categories');

use HasCompositePrimaryKey;

$this->find($ids, $columns = ['*']);
$this->setKeysForSaveQuery($query);

use PasswordStrength;

use PasswordValidationRules;

use SaveToUpper;

use SetNullOnEmpty;

$this->setNullOnEmpty($input);

use TriggerHelper;

$this->switchDatabaseTrigger($enable = true, $table = null, $trigger = null, string $connection = 'sqlsrv');

use TableHelper;
bash
php artisan vendor:publish --tag="utilities-config"
bash
composer analyse