Example #1
0
$app->register(LogServiceProvider::class);
$app->register(ContextServiceProvider::class);
$app->register(SluggableServiceProvider::class);
//Domain service providers
$app->register(UserServiceProvider::class);
$app->register(AccountServiceProvider::class);
$app->register(AuthServiceProvider::class);
/*
|--------------------------------------------------------------------------
| Register Alias
|--------------------------------------------------------------------------
|
*/
// I register the db alias here because the Application::registerContainerAliases()
// doesn't register it by default like laravel does, it's probable because the db is not always
// register by default.
$app->alias('db', DatabaseManager::class);
/*
|--------------------------------------------------------------------------
| Load The Application Routes
|--------------------------------------------------------------------------
|
| Next we will include the routes file so that they can all be added to
| the application. This will provide all of the URLs the application
| can respond to, as well as the controllers that may handle them.
|
*/
$app->group(['namespace' => 'App\\Http\\Controllers'], function ($app) {
    require __DIR__ . '/../app/Http/routes.php';
});
return $app;
Example #2
0
|--------------------------------------------------------------------------
|
| Here we will register all of the application's service providers which
| are used to bind services into the container. Service providers are
| totally optional, so you are not required to uncomment this line.
|
*/
$app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\EventServiceProvider::class);
$app->register(LaravelDoctrine\ORM\DoctrineServiceProvider::class);
$app->register(Laravel\Socialite\SocialiteServiceProvider::class);
// ================================================================
//                              JWT:
// ================================================================
$app->alias('cache', 'Illuminate\\Cache\\CacheManager');
$app->alias('auth', 'Illuminate\\Auth\\AuthManager');
$app->configure('jwt');
$app->register(Tymon\JWTAuth\Providers\LumenServiceProvider::class);
$app->withFacades();
class_alias('Tymon\\JWTAuth\\Facades\\JWTAuth', 'JWTAuth');
/** This gives you finer control over the payloads you create if you require it.
 *  Source: https://github.com/tymondesigns/jwt-auth/wiki/Installation
 */
//class_alias('Tymon\JWTAuth\Facades\JWTFactory', 'JWTFactory'); // Optional
/*$app->routeMiddleware([
    'auth'    => Tymon\JWTAuth\Middleware\GetUserFromToken::class,
    'jwt.refresh' => Tymon\JWTAuth\Middleware\RefreshToken::class,
]);*/
/*
|--------------------------------------------------------------------------