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
8
votes
4 answers

Can't Truncate Table Befor Seeding

I want to truncate my user table befor seed.i do like this : DatabaseSeeder.php :
Omid Reza Heidari
  • 658
  • 12
  • 27
8
votes
2 answers

Could not submit form-data through postman put request

I m using lumen api 5.6. This is my route $router->PUT('collections/{collectionId}' In postman i m calling this api like this. and this is the body of that request See here i have CollectioPoints here but its failing in validation. the data i m…
Joyner
  • 312
  • 1
  • 2
  • 11
8
votes
0 answers

Lumen Auth Microservice

I am working on my first microservices based application. As most of the microservices architectures, there is an API Gateway that will reduce the number of requests a client has to make. Since this is the single entry point inside the app, I…
Sergiu
  • 345
  • 2
  • 5
  • 18
8
votes
5 answers

Class Memcached Not Found Lumen 5.4

When trying to run artisan commands I get the following error [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'Memcached' not found I had recently been been working on another project that used Lumen 5.3 and had no problem running…
Danny Connolly
  • 879
  • 3
  • 10
  • 27
8
votes
6 answers

Lumen command not found

I'm trying to install lumen for my new project. While using the lumen command in terminal it says " Command not found " Image of my terminal commands composer global require "laravel/lumen-installer" lumen new firstapp What's wrong?
Leslie
  • 81
  • 2
  • 8
8
votes
2 answers

Where to put business logic in Lumen?

I am developing my first API with Lumen. Normally I am using services for separating business logic or reused code from the controllers and share it with other controllers. How to do this with lumen? Where to put the services? I only see…
rakete
  • 2,953
  • 11
  • 54
  • 108
8
votes
3 answers

Laravel: JSON and pivot table

Sorry about the non-explanatory title but I could not come up with a descriptive one. I've got the following 3 tables: - games - platforms - games_platforms And I've got 2 Models in Laravel for both Platform and Game. public function games()…
Serellyn
  • 405
  • 1
  • 9
  • 26
8
votes
1 answer

Post bodies ignored when making multiple post calls in laravel test

I've been running into problems writing my phpunit tests in lumen5.2 with laravel components. If I make multiple http calls to my API within a single test,the body I supply for subsequent calls is ignored in favor of the first body supplied to any…
Nathan Clow
  • 119
  • 6
8
votes
6 answers

How can I set Timezone in lumen 5.2?

I did not find any relevant information (only tricks) about how to set the default timezone in Lumen 5.2. Is there any clean way to do this?
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
8
votes
3 answers

Lumen HTTP Basic Authentication without use of database

I'm creating a RESTful API using Lumen and would like to add HTTP basic Authentication for security. On the routes.php file, it set the auth.basic middle for every routes: $app->get('profile', ['middleware' => 'auth.basic', function() { //…
basagabi
  • 4,900
  • 6
  • 38
  • 84
8
votes
2 answers

Lumen: how to pass parameters to controller from route

from my route i need to pass the value of $page to controller route: $app->get('/show/{page}', function($page) use ($app) { $controller = $app->make('App\Http\Controllers\PageController'); return $controller->index(); }); controller: public…
jrsalunga
  • 409
  • 2
  • 8
  • 20
8
votes
3 answers

Lumen: how can I get url parameters from middleware

This is my routes.php: $app->get('/users/{id}/', ['middleware' => 'example', function () { return "users"; }]); This is the handle function in the middleware: public function handle($request, Closure $next) { // I would like to get the value of…
Andrea
  • 15,900
  • 18
  • 65
  • 84
7
votes
8 answers

Laravel / Lumen ReadOnly Model?

There are some tables in our system which are being fed using 3rd party APIs and our system is supposed only read data from them and never Insert or Update anything. Is there any feature in Laravel/Lumen, where we can mention in the Model to…
Deepanshu Goyal
  • 2,738
  • 3
  • 34
  • 61
7
votes
2 answers

How to call app_path() function in laravel lumen?

How to call app_path() function or to make a Helper for app_path() function in Laravel lumen? I need it because i got this error,.. "Call to undefined function app_path()" It has a package here for that,.. but is not supported for Laravel Lumen…
AbingPj
  • 619
  • 8
  • 18
7
votes
1 answer

Lumen - Routing with Prefix and Optional Parameter

I'm looking at routing in Lumen and it doesn't appear to be working correctly and I can't work out if it's an issue or my understanding. $router->get('{adaptor}[/{id}]', ['uses' => 'MyController@readAction']); This way works, but I'd prefer to…
Farkie
  • 3,307
  • 2
  • 22
  • 33