Example #1
0
| 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';
/*
 * Setup Propel
 */
if (defined('LARAVEL_ENV')) {
    require app_path() . '/config/propel/config.php';
    if (LARAVEL_ENV == 'local') {
        $con = Propel\Runtime\Propel::getWriteConnection(\Zidisha\User\Map\UserTableMap::DATABASE_NAME);
        Debugbar::addCollector(new DebugBar\DataCollector\PDO\PDOCollector($con->getConnection()));
    }
}
/*
 * Extending auth class with propel
 */
Auth::extend('propel', function ($app) {
    return new \Zidisha\Auth\PropelUserProvider();
});
/**
 * Custom validator class
 */
Validator::resolver(function ($translator, $data, $rules, $messages) {
    return new Zidisha\Form\ZidishaValidator($translator, $data, $rules, $messages);
});