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
7
votes
2 answers

How to reinstall the libzip distribution when build lumen in docker

I use docker version Version 17.12.0-ce-mac55 (23011) on osx version 10.11.6. I have a problem when I build lumen on docker, but when the build process is finished there is an error like this : configure: error: Please reinstall the libzip…
yusuf
  • 131
  • 2
  • 6
7
votes
1 answer

Laravel Lumen - Log channels

I need to log to two different files for two different cases. Something like this: Log::channel('case1')->info('msg1'), Log::channel('case2')->info('msg2'), How can I do this in Lumen? I read about Laravel's way of doing this through channels…
Fractalf
  • 5,228
  • 3
  • 23
  • 26
7
votes
3 answers

Getting route parameters in Lumen

When trying to access Route parameters, using $request->route('id'), in latest version of Lumen, I get an error. lumen.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function parameter() on array It works fine in…
Zoon
  • 1,068
  • 2
  • 11
  • 26
7
votes
1 answer

How to neatly handle Exceptions in Artisan Commands

Using Lumen to create an API - love Laravel but all the View's that come with it were overkill for the project I am creating. Anyway, I've made a series of Commands which go out and collect data and stores it to the database.
Moe
  • 4,744
  • 7
  • 28
  • 37
7
votes
1 answer

create-react-app proxy requests to php backend

I'm running a Lumen (5.3) API via $ php -S localhost:8888 -t public when I hit any endpoint through postman it works without fail. However, when I try to curl localhost:8888/v1/auth/login for example I am given the following error: curl: (7)…
j_quelly
  • 1,399
  • 4
  • 16
  • 37
7
votes
2 answers

How to use multiple database in Lumen

We've using Lumen for building API's , Now we need to access multiple databases. Currently using .env for database config but unable to found the way to multiple databases in .env where we need to read 2nd connection ...
Govind Samrow
  • 9,981
  • 13
  • 53
  • 90
7
votes
2 answers

What is the purpose of grant_type parameter in OAuth 2 Authentication

I am using OAuth 2 Authentication in Lumen microframework. Right now i am using the grant_type value is password. It throws unsupported_grant_type, If i am using something different. I want to know the purpose of using grant_type is password
Hariharan
  • 1,174
  • 2
  • 12
  • 17
7
votes
3 answers

Target [Laravel\Socialite\Contracts\Factory] is not instantiable

I am using laravel lumen 5.2. Target [Laravel\Socialite\Contracts\Factory] is not instantiable. I came across this error when trying to get Laravel to login with Twitter using the Socialite package. Work already done: A) In config\app.php 1.…
Sannan
  • 83
  • 1
  • 5
7
votes
2 answers

Laravel Lumen call artisan command from route

In Laravel, I can do this to call an Artisan command from a route: Route::get('/foo', function () { $exitCode = Artisan::call('email:send', [ 'user' => 1, '--queue' => 'default' ]); // }); But I can't find an obvious way to do…
Jared Eitnier
  • 7,012
  • 12
  • 68
  • 123
7
votes
2 answers

Lumen: Enable CORS

I built an API with Lumen and want to access it with JavaScript and the XMLHttpRequest object. But every time my PUT, GET, POST, and DELETE requests are transformed into OPTIONS - Request. I read a lot of websites with information of CORS. I build…
Nis
  • 171
  • 1
  • 2
  • 8
7
votes
2 answers

file_get_contents with Lumen

I have this code into a function (php class) : $theFile = '/test/test.xml'; // these are in the public folder dd(file_get_contents($theFile)); If I go to mydomain.local/test/test.xml, I get the working xml code. But with file_get_contents, I get…
w3spi
  • 4,380
  • 9
  • 47
  • 80
7
votes
1 answer

Is it possible to use cyrillic symbols in Lumen(by Laravel)?

The issue is I can't use any russian symbols in the response()->json() method. I've already tried the following code: return response()->json(['users' => 'тест']); and return response()->json(['users' => mb_convert_encoding('тест',…
Sergey
  • 5,396
  • 3
  • 26
  • 38
7
votes
1 answer

Using Carbon dates in Laravel/Lumen

I am building a webservice based on the latest version of Lumen to use with a Guzzle 6 client. The webservice is working but when I acces a carbon date on the client with: $newsitem->publish_start->formatLocalized('%A %d %B %Y') I get the following…
Klaaz
  • 1,590
  • 3
  • 23
  • 46
7
votes
9 answers

How to get the current route on middleware in lumen framework?

I have develop the API application using lumen. And for the access permission control. I want to get the current route in middleware. But, I always get null on: $route = $request->route(); I already try the way on the Can I get current route…
Yo_win
  • 81
  • 1
  • 1
  • 3
7
votes
2 answers

Laravel Lumen - Eloquent Query Log

I'm using Laravel Lumen to build an API. I've come to a point where I need to find out what SQL query is being generated by Eloquent. I know how to do this in Laravel 4 and Laravel 5 but i've tried the same code in Lumen and the query is…
ajtrichards
  • 29,723
  • 13
  • 94
  • 101