PHP code example of mahmud / laravel-utilities

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

    

mahmud / laravel-utilities example snippets


use Illuminate\Support\Facades\Validator;

$validator = Validator::make(['foo' => 'বার'], ['foo' => new Ascii()]);
$validator->fails() // true

use Illuminate\Support\Facades\Validator;

$hashedPassword = bcrypt('123456');

$validator = Validator::make(['password' => '123456'], ['password' => 'hash_check:' . $hashedPassword]);
$validator->passes() // true

number($number, $decimal = 2)

echo number(7.236)  // 7.24
echo number(3.14159, 4) // 3.1416
echo (3.14159, 0) // 3.0