PHP code example of hooshid / laravel-helpers

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

    

hooshid / laravel-helpers example snippets


get_excerpt($text, $maxChars = null, $suffix = '...', $br = true, $clean_html = true);


format_bytes($bytes, $precision = 2);


clean_string($value, $functions = null);


phone($phone);


$image = image('/images/test.jpg');

// /images/test.jpg


$gravatar = gravatar('[email protected]');


$lower = str_lower('TeSt');

// test

$upper = str_upper('TeSt');

// TEST
 php
'providers' => [
    Hooshid\Helpers\HelperServiceProvider::class,
];
 php
php artisan vendor:publish --provider="Hooshid\Helpers\HelperServiceProvider"
 php
php artisan vendor:publish --provider="Hooshid\Helpers\HelperServiceProvider" --tag="config"
 sh
php artisan make:helper MyHelper
 php
if (!function_exists('hello')) {

    /**
     * say hello
     *
     * @param string $name
     * @return string
     */
    function hello($name)
    {
        return 'Hello ' . $name . '!';
    }
}