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
0
votes
1 answer

Initialize table in Eloquent ORM with default values

I'm creating a API in Lumen framework, using Eloquent ORM to acess my databases. I've already used Factories and Models to generate random rows in my table. What I want know is to generate real data, default values if my table is empty. I'll have a…
Marlon
  • 1,719
  • 3
  • 20
  • 42
0
votes
1 answer

How to create a compound object in a REST API

I'm creating a REST API for my application, and I have a doubt about how to design my API, following REST principles. I'm using PHP and Lumen, but I guess it's more a design doubt than a technical one. Consider I have two entities: Company: -…
Marlon
  • 1,719
  • 3
  • 20
  • 42
0
votes
1 answer

Guzzlehttp 7.3 JSON_UNESCAPED_SLASHES not working (Lumen/Laravel)

I am having an issue with an app created in Lumen and Guzzlehttp requests. Looks like I cannot pass options like JSON_UNESCAPED_SLASHES whenever I am doing a request: $response = (new Client())->request($this->typeRequest, $endpoint,…
Leizar999
  • 1
  • 3
0
votes
1 answer

Lumen route without controller

I have code in my lumen route like this $route->group([ "namespace" => "jobs", "prefix" => "jobs" ], function() use ($router) { $route->get("/", "DummyController@index"); }); And i want to change some line to be like…
Vee
  • 11
  • 2
0
votes
0 answers

Lumen/Eloquent transaction rollback is not working

I have this function that permit to save in 4 tables. I have an error at that line $stade->save() ( it's normal it's a test ) so it should not save the club $club->save() that is 4 lines before. But I don't understand why, the rollback() in the…
Fizik26
  • 753
  • 2
  • 10
  • 25
0
votes
4 answers

Lumen 8 - Using Faker in tests makes InvalidArgumentException: Unknown format "name"

I'm using Lumen default Tests only added this line to the test : $users = \App\Models\User::factory()->count(5)->create(); But i get this error when running the test : InvalidArgumentException: Unknown format "name" I did't touch the UserFactory…
John
  • 578
  • 1
  • 3
  • 15
0
votes
1 answer

Failed sending mail in Lumen

i'm trying to make a custom email configuration in the service provider, and when trying to send an email i got this error Argument 1 passed to Illuminate\Mail\MailManager::getConfig() must be of the type string, null given…
0
votes
0 answers

Lumen server integration with php-my-admin instance

I'm loading my lumen project on a server that already has a php-my-admin instance loaded onto it. After the project loading the php-my-admin panel becomes unreachable. I'd like to keep using that istance with the lumen project, i have found some…
Djamaica
  • 29
  • 4
0
votes
1 answer

How to call a method, function or initialize class after an middleware in a controller constructor in Laravel and Lumen?

How to call a method, function or initialize class after an middleware in a controller constructor in Laravel and Lumen? I try initialize class Translator after middleware('lang'), but class Translator initialized before execute…
0
votes
1 answer

Trying to have access to route parameters inside group routing

I'm trying to have access to {module} inside my function, but it returns me the following error : Too few arguments to function {closure}(), 1 passed in /Users/Bernard/PROJECTS/myproject/vendor/laravel/lumen-framework/src/Routing/Router.php on line…
Bernard
  • 155
  • 1
  • 10
0
votes
1 answer

How can I preserve model state across multiple Laravel/Lumen listeners that receive an event?

Using Lumen 5.5, PHP 7.3 My goal is to extend existing functionality on a model while maintaining code cleanliness. Using the Event/Listener pattern made sense but I'm hitting some design issues where I need access to the original state of the model…
Adam Bellas
  • 322
  • 2
  • 6
0
votes
1 answer

It is posible to stop event listener propagation when first listener fails? Laravel Lumen

I have one event with two listeners. I need to stop listener propagation when the first listener fails. For example: Event: RegisterUserEvent Listeners: StoreUserListener and SendVerificationEmailListener If, for any reason, the user can't be stored…
0
votes
0 answers

docker compose for php microservice

I want to build a restful API application using docker, Nginx, and Lumen that contains API gateway, microservices, and database container. I need microservice that cannot be accessed from the internet and API gateway will communicate with…
0
votes
1 answer

How to run Laravel (Lumen) Scheduler on Docker

I am new to running Laravel scheduler on Docker. So I find it difficult to run multiple commands (php -S localhost:8000 -t public and php artisan schedule:work) in the Dockerfile. Please help, what do I need to do to run scheduler successfully as I…
0
votes
1 answer

lumen - Why does PHPUnit register test returns 405?

I want to make phpunit tests for lumen app, like : public function testRegisterUser() { $newUserData = [ 'name' => 'test_user', 'email' => 'test_user@mail.com', 'password' => Hash::make('111111'), …
Petro Gromovo
  • 1,755
  • 5
  • 33
  • 91