PHP code example of devtical / laravel-helpers

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

    

devtical / laravel-helpers example snippets




declare(strict_types=1);

if (! function_exists('str_slug')) {
    function str_slug($text, $separator = '-')
    {
        return Str::slug($text, $separator);
    }
}

// In your controllers, models, views, etc.
$slug = str_slug('Hello World'); // Returns: hello-world
bash
php artisan vendor:publish --tag=helpers-config
bash
php artisan make:helper <NAME>