-
Save the Gist as
helpers.php. -
Place the file in the
app/Helpers directory(create the directory if it doesn't exist). -
Add the following line to your
composer.jsonfile to autoload the helpers:
"autoload": {
"files": [| <?php | |
| namespace App\Console\Commands; | |
| use Illuminate\Console\Command; | |
| use Illuminate\Support\Facades\Cache; | |
| class ClearOptimize extends Command | |
| { | |
| /** |
Cloudflare Tunnels provide a secure way to expose your local services to the internet without opening ports 80/443 on your firewall. Traffic flows through Cloudflare's network directly to your services via an encrypted tunnel.
| <?php | |
| // Don't forget to autoload this in composer.json or create a service provider | |
| if (!function_exists('generate_username')) { | |
| /** | |
| * Generate a unique username from email or name | |
| */ | |
| function generate_username($input, $model = 'App\Models\User', $column = 'username') | |
| { | |
| // Extract base from email or clean the name |