Questions tagged [lumen]

Lumen is a "micro-framework" built on top of Laravel's components, and is the official micro-framework of Laravel. Lumen is targeted at microservices--small, loosely-coupled components that usually support and enhance a core project.

Lumen is the perfect solution for building based micro-services and blazing fast APIs. In fact, it's one of the fastest micro-frameworks available.

Feature Overview

  • Templating
  • Caching
  • Command Scheduler
  • Controllers
  • Eloquent ORM
  • Error Handling
  • Database Abstraction
  • Dependency Injection
  • Logging
  • Queued Jobs

Documentation

Other notable tags

Community

Other Useful Resources

2610 questions
16
votes
4 answers

Custom 404 page in Lumen

I'm new to Lumen and want to create an app with this framework. Now I have the problem that if some user enters a wrong url => http://www.example.com/abuot (wrong) => http://www.example.com/about (right), I want to present a custom error page and…
what
  • 338
  • 1
  • 6
  • 13
16
votes
2 answers

No table name set on execute migration in Lumen

I'm facing this error when attempting to run the migration in Lumen Framework: $ php artisan migrate:install [Illuminate\Database\QueryException] SQLSTATE[42000]: Syntax error or…
henriale
  • 1,012
  • 9
  • 21
15
votes
7 answers

How can I get table name, statically from Eloquent model?

Right now I have this code to check to which table an Eloquent model is connected into. $s = new Something(); dd($s->getTable()); Is there anyway I can get the table without instantiating new Something object? I was thinking something like these…
notalentgeek
  • 4,939
  • 11
  • 34
  • 53
15
votes
2 answers

How to integrate Swagger in Lumen/Laravel for REST API?

I have built some REST API in Lumen micro framework and it's working fine. Now I want to integrate Swagger into it so the API will be well documented on future use. Has anyone done this?
Anand Pandey
  • 2,025
  • 3
  • 20
  • 39
15
votes
4 answers

Just installed Lumen and got NotFoundHttpException

I'm searching for a solution ... it's getting so frustrating. After a fresh installation of Lumen by Laravel, I simply can't access the "/" route. When I try to, it throws an error: NotFoundHttpException in RoutesRequests.php line 443: in…
robertsan
  • 1,591
  • 3
  • 14
  • 26
15
votes
1 answer

Why is the gzip minimum length directive not being respected?

If I understand correctly it's better not to gzip small resources as they might actually get bigger while still having a performance hit on the CPU. So using the gzip_min_length directive is an obvious solution to that. However, when trying this on…
Jonathan
  • 1,041
  • 1
  • 12
  • 21
15
votes
3 answers

Lumen and MongoDB?

Is it somehow possible to include the mongodb connection settings into a lumen framework. As from what I saw the config/database.php is loaded internally in the lumen package. Is there a way to extend it somehow to include the mongodb connection…
Galin Denev
  • 153
  • 1
  • 1
  • 5
15
votes
2 answers

Lumen unpredictable output

Recently, I installed lumen (5.0.4) mfw and ran into an issue with page load on default configuration. I have unpredictable behavior of page load process. Sometimes it loads okay but sometimes instead of loading I am getting a download dialog with…
mixone
  • 159
  • 3
14
votes
3 answers

How can I use JSON API Resource in a Lumen project?

In Laravel it can be done as simply as it is described here: https://laravel.com/docs/5.6/eloquent-resources. Some says, API Resources is not meant for Lumen. However, just for the sake of this question, I want to know, strictly, if there is a way…
notalentgeek
  • 4,939
  • 11
  • 34
  • 53
14
votes
5 answers

Laravel | Unique validation where clause

I am trying to validate the input of a email address that exists but only when the company_id is the same as the company_id which is passed in with the request. I am getting this error... SQLSTATE[42S22]: Column not found: 1054 Unknown column '1'…
user8116198
14
votes
2 answers

anahkiasen/former form builder lib for Lumen / (Laravel micro framework)

I'm using Lumen, the Laravel recently new micro framework. I was searching for a form builder and I found Former : http://anahkiasen.github.com/former/ I put in a simple blade view the following code : use Former\Facades\Former; echo…
Alexis Romot
  • 524
  • 6
  • 19
14
votes
3 answers

lumen framework routing not working

I use the Lumen framework for first time, the route / to my HomeController is not working. This is my route.php: $app->get('/', 'HomeController@index'); But I get the following error: [2015-04-17 07:03:41] lumen.ERROR: exception…
refear99
  • 1,217
  • 3
  • 10
  • 13
13
votes
2 answers

Lumen middleware sort (priority)

I'm using "laravel/lumen-framework": "5.7.*" I have two middlewares, first one AuthTokenAuthenticate that should be applied to all the routes, so its defined in bootstrap/app.php like $app->middleware([ …
Seva Kalashnikov
  • 4,262
  • 2
  • 21
  • 36
13
votes
4 answers

Docker + Laravel queue:work

I'm trying to run the following command after the container is up and running. php artisan queue:work -n -q & The "&" is there because the daemon option was deprecated and later removed from Laravel. However, this breaks my container startup…
Borjante
  • 9,767
  • 6
  • 35
  • 61
13
votes
3 answers

Laravel Model Factory without connection to database

I would like to use Laravel's Model Factory in some PHPUnit tests. The only thing I want to do is make a Model instance without saving it to database. Why the Model Factory needs connection to database? These tests must pass on CI environment…
user1292810
  • 1,702
  • 7
  • 19
  • 38