Example #1
0
|
*/
App::down(function () {
    return Response::make("Be right back!", 503);
});
/*
|--------------------------------------------------------------------------
| Require The Filters File
|--------------------------------------------------------------------------
|
| Next we will load the filters file for the application. This gives us
| a nice separate location to store our route and application filter
| definitions instead of putting them all in the main routes file.
|
*/
require app_path() . '/filters.php';
/*
 * Models Stuff
 */
Category::creating(function ($category) {
    $category->words = count($category->wordcards);
});
Category::updating(function ($category) {
    $category->words = count($category->wordcards);
});
/*
 * Custom validator
 */
Validator::extend('alpha_spaces', function ($attribute, $value) {
    return preg_match('/^[\\pL\\s.]+$/u', $value);
});