Skip to content

Instantly share code, notes, and snippets.

@FlorianWeigang
FlorianWeigang / NickNameGenerator.php
Created April 27, 2017 08:01
This class generates nicknames out of an email address. This is useful if you have an interface and you dont want to show the email addresses of your customers / users to the world. It cuts the first part of your email address and checks if there are two different names present in the first part and takes the first char of the first two found na…
<?php
/**
* Class NickNameGenerator
*
* Example:
*
* [email protected] => EM
* [email protected] => ED
* [email protected] => EF
@FlorianWeigang
FlorianWeigang / filters.php
Last active August 14, 2023 02:26
static laravel basic.auth with username and password in config file
<?php
/**
* change this definition in filters.php.
*
* the code checks if the auth parameters matches the credentials in your config file, if not
* a WWW-Authenticate Header will be send to the client.
*/
Route::filter('auth.basic', function () {
$login = false;