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

How to manually run a laravel/lumen job using command line

I have created a Job file in the folder app/Jobs/MyJob.php and i would like to run it just once, if its possible using command line. Something like: > php MyJob:run what command should I use to run a method in this file or the handle?
Oscar Gallardo
  • 2,240
  • 3
  • 27
  • 47
23
votes
8 answers

Sessions in token based authentication

I am building an app in PHP Lumen which returns a token upon login. I am not sure how to proceed beyond this. How am I supposed to maintain a session using these tokens? Specifically, how do I store the tokens on the client side if I am using…
Flame of udun
  • 2,136
  • 7
  • 35
  • 79
23
votes
5 answers

Why has the artisan serve command been removed from Lumen 5.2?

Please. Does anybody know why Lumen's team removed the command php artisan serve? That command was very helpful !.
vanhonit
  • 607
  • 1
  • 5
  • 14
21
votes
3 answers

Lumen/Laravel 6: Call to undefined function array_except()

So my Mailable view is throwing this error - and this is all I have on my hands. It was working fine while I was on Lumen 5.8, so my guess is that it happened after upgrading to Laravel 6. Call to undefined function array_except() (View: …
pop
  • 3,464
  • 3
  • 26
  • 43
20
votes
3 answers

Apache alias for Laravel and Lumen

I'm trying to make an alias on my server which directs all traffic that comes into example.com/z/ to a different directory than the rest of example.com, where example.com has a Laravel 4.2 install and example.com/z/ has a Lumen install which runs a…
Samsquanch
  • 8,866
  • 12
  • 50
  • 89
19
votes
4 answers

Enabling session in lumen framework

I have two (but let's image more) micro-services (API) which need to be aware of authenticated user. Ideally I would simple like to resume their sessions. All micro-services are using same storage for sessions: redis. All API calls will have Cookie…
rock3t
  • 2,193
  • 2
  • 19
  • 24
18
votes
3 answers

Method Illuminate\Auth\RequestGuard::attempt does not exist

I am new to both laravel and lumen. I was creating a login api with oauth2.0 in lumen 5.6, i have installed passport and generated token. Below is my login controller function and it is working fine. It returns token. namespace…
Sanju Kaniyamattam
  • 501
  • 1
  • 4
  • 14
18
votes
1 answer

Access Tokens: Revoke vs Delete

I am creating a route /user/logout using dusterio/lumen-passport and in the controller action i manually revoke tokens which leads to the user being logged out. I have two options to log out a user. Revoke the token (which persists the token in the…
d3p4n5hu
  • 411
  • 4
  • 9
18
votes
4 answers

Enable CORS in lumen

I have API developed using lumen. I can get request using postman. But when request using Jquery.ajax it is not working. So I need to know how to enable CORS in lumen API.
Ishan Fernando
  • 2,758
  • 1
  • 31
  • 38
18
votes
1 answer

How to specify Lumen (or Laravel) version on new installation?

I want to install a specific version of Laravel Lumen (5.1 instead of the lastest one 5.2) on a new project. From the documentation : lumen new blog or : composer create-project laravel/lumen --prefer-dist Does not work : it install the lastest…
Ifnot
  • 4,914
  • 4
  • 33
  • 47
18
votes
2 answers

Not found page in Lumen after install

I just installed Lumen but when I head to its public directory localhost/lumen/public, Sorry, the page you are looking for could not be found. will appear. I checked app\Http\routes.php and changed $app->get('/', function () use ($app)…
Sky
  • 4,244
  • 7
  • 54
  • 83
17
votes
5 answers

Bcrypt not working in Lumen 5.4: Call to undefined function bcrypt()

I created a new Lumen 5.4 project and tried to seed some data. In the seeder, I used bcrypt to hash the password. But when I run php artisan db:seed, I get this error: Call to undefined function bcrypt() Why can't I use bcrypt in Lumen? I have used…
JackSlayer94
  • 805
  • 3
  • 16
  • 38
17
votes
1 answer

base_uri not being based from guzzle client instantiation

I'm using lumen trying to set up simple API requests via guzzle. The problem is the base_uri parameter doesn't appear to be passed correctly on the initial new Client(). Simplified example: use GuzzleHttp\Client; $client = new Client([ 'base_uri'…
drrobotnik
  • 739
  • 1
  • 11
  • 25
16
votes
1 answer

Firebase authentication for private server

I am developoing a flutter app and want to use Firebase auth service to enable my users to signup/login using: email/pass google facebook I have a lumen backend REST server with MySQL database. Problem: Going through loads of firebase…
Mantoska
  • 1,349
  • 1
  • 12
  • 28
16
votes
2 answers

Auth guard driver [api] is not defined. Lumen, Dingo, JWTAuth

I am trying to develop a rest api using lumen. For authentication I am using Dingo and JWTAuth api, but I am getting the following message: Auth guard driver [api] is not defined. Below is a screenshot of the message from Postman, including the…
sharif rahman
  • 193
  • 1
  • 3
  • 12