PHP code example of daltcore / laravel-useful-helpers

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

    

daltcore / laravel-useful-helpers example snippets


/**
* Generate a password without i o 0 I l L etc.
**/
echo user_friendly_password($length = 9, $add_dashes = false, $available_sets = 'lud');

/**
* In case of named routes, you can use this function to transform the uri '/' to web.home.index
* @param null|string $uri    = '/'
* @param string      $method = 'GET'
**/
echo route_name(); // site.home.show
echo route_name(\URL::current()); // site.home.show
echo route_name('cms/user/1/delete', 'DELETE'); // cms.user.delete

/**
 * Check if the given route name is or are the same as the current route
 *
 * @param  string $route
 * @return boolean
 */
if (active_route('cms.post.*')) { ...

/**
 * Check if the current uri contains the given uri
 *
 * @param  string  $uri
 * @param  boolean $strict
 * @return boolean
 */
if (activeUri('posts')) { ...
if (activeUri('posts', true)) { ...