Skip to content

Instantly share code, notes, and snippets.

@bartjakobs
Last active January 28, 2019 09:16
Show Gist options
  • Save bartjakobs/57986122a72e297b0bd348a4737ce35f to your computer and use it in GitHub Desktop.
Save bartjakobs/57986122a72e297b0bd348a4737ce35f to your computer and use it in GitHub Desktop.
Lumen project
# Lumen projectje in elkaar zetten
lumen new project
cd project
composer require barryvdh/laravel-cors
composer require vluzrmos/tinker
composer require wn/lumen-generators
composer require tymon/jwt-auth
composer require league/flysystem
cp .env.example .env
<?php
// after $app =
$app->withFacades();
$app->withEloquent();
$app->configure('database');
$app->configure('auth');
$app->configure('filesystems');
// after $app->singleton
$app->singleton(
Illuminate\Contracts\Filesystem\Factory::class,
function ($app) {
return new Illuminate\Filesystem\FilesystemManager($app);
}
);
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
]);
$app->routeMiddleware([
'cors' => \Barryvdh\Cors\HandleCors::class,
]);
//bla
$app->register(Tymon\JWTAuth\Providers\LumenServiceProvider::class);
$app->register(Barryvdh\Cors\ServiceProvider::class);
$app->register (Sentry\SentryLaravel\SentryLumenServiceProvider::class);
<?php
// after $kernel = ...
if(class_exists('Vluzrmos\Tinker\TinkerServiceProvider')) {
$app->register('Vluzrmos\Tinker\TinkerServiceProvider');
}
if ($app->environment() == 'local') {
$app->register('Wn\Generators\CommandsServiceProvider');
}
<?php
return [
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
'guards' => [
'api' => [
'driver' => 'jwt',
'provider' => 'users',
],
],
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => \App\User::class
]
]
];
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3", "rackspace"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
],
],
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment