I’m currently building a RESTful API using , from the guys that brought to us . Lumen is a great micro-framework with most of the spectacular features from Laravel like Eloquent, caching, validation, routing, middleware and so on and so forth. The API I’m building it’s supposed to serve an, yet to develop, iOS app that it’s meant to support the information system of the college where I attend, which don’t correctly support mobile devices. Lumen Laravel This would be a pretty straightforward project but they won’t make my life easy and won’t let me to access the existing database. It sucks, right? However they have a available that I can use. But… If I used their web service alongside my API every time I made a request it would take ages to get the information I’ve requested. This is, obviously, a shitty way to do things. So I’ve decided to implement a database where I can store the data by myself. unfortunately SOAP Web Service I’m fully aware that we shouldn’t repeat data but I can’t find a better way this time. I’ve decided to develop some Python bots that would periodically fetch information using the SOAP web service and store it on the database to be later served using the REST API. I’ve decided to use mostly for its flexibility, performance and scalability. I’m using mongo 3.4 so all the commands below are tested for this version. mongoDB So… How to setup Lumen to use mongoDB has a wonderful Composer package to use mongoDB with Laravel: . Looking at the repo instructions you can see that, for using with Lumen and after you installed the package, edit the file and make it look like: Jens Segers Laravel MongoDB bootstrap/app.php $app->register(Jenssegers\Mongodb\MongodbServiceProvider::class); $app->withEloquent(); After this you should create the file and it’s contents are: config/database.php <?phpreturn ['default' => 'mongodb','connections' => ['mongodb' => ['driver' => ‘mongodb','host' => env('DB_HOST', 'localhost'),'port' => env('DB_PORT', 27017),'database' => env('DB_DATABASE'),'username' => env('DB_USERNAME'),'password' => env('DB_PASSWORD'),'options' => ['database' => 'admin' // sets the authentication database required by mongo 3]],],‘migrations’ => ‘migrations’,]; This will override and it will allow you to use mongo with your Lumen project. After this you have you change our file and append: vendor/laravel/lumen/config/database.php .env DB_CONNECTION=mongodbDB_HOST=<dbHost>DB_PORT=27017DB_DATABASE=<dbName>DB_USERNAME=<dbUser>DB_PASSWORD=<dbUserPassword> Out of the box mongo doesn’t have any authentication details. You can add your own user to it using: use admin Now I’m able to use Lumen’s commands, for instance, I can create my table using: artisan users php artisan make:migration create_users_table — create=users I’ve modified the migration file like: public function up() {Schema::create(‘users’, function (Blueprint $table) {$table->increments(‘_id’);$table->string(‘username’);$table->string(‘password’);$table->timestamps();});} Now I can use and I’ll see my newly created collection. php artisan migrate