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.
2,545
questions
0
votes
1
answer
24
views
Can't send mail with Lumen framework and no error appears
Since yesterday I have had problems sending emails with Lumen. I think I have followed all the steps in the documentation correctly, but unfortunately I cannot send anything. Moreover, no error is ...
0
votes
0
answers
25
views
How to optionally call mutator in lumen
i use mutator in my model to encrypt id:
public function getIdAttribute($value)
{
return encrypt($value);
}
but I want the default value to be the original value of the id and call the mutator ...
0
votes
0
answers
10
views
Laravel does not get the temppath when upload bigger files
I need to handle a file in a Laravel controller,
TL;DR
How to handle big files through laravel requests?
When I make the request with the small file, its tempPath is normal: /tmp/php3Hijl5
But when I ...
0
votes
0
answers
8
views
Lumen - Authorizable - it is not a trait
Following steps from following url https://bestofphp.com/repo/dusterio-lumen-passport-php-authentication- did authentication of Passport in Lumen. It was works well when Authorizable and ...
0
votes
2
answers
30
views
Lumen prevent duplicate job in a queue
Using lumen 8.2.3 I am only trying to dispatch a unique job to a queue. In app/Console/Kernel I have sent a schedule to $schedule->job(new myJob(), 'high')->everyMinute(); this runs every ...
1
vote
0
answers
39
views
Lumen unusual return value only when tried in Android (Kotlin)
I have a problem about unusual return in my lumen app version 7.
My teammate who is using kotlin in his android try to execute my api with case task_id and id is correctly inputed, he always got
[&...
0
votes
0
answers
8
views
How to generate a user referral link in lumen
I am new to Laravel Lumen and I would like to create a referral link api for my project.
I would like to know is it possible to generate a referral link when an user register an account in lumen ?
...
0
votes
0
answers
19
views
Laravel Loggin send email with monolog NativeMailerHandler
I'm trying to use a laravel logging channel to send an email with the error, but I can't get anything to be sent, I'm trying with monolog and NativeMailerHandler but I still can't send anything, ...
-1
votes
0
answers
14
views
Request blocked by CORS policy, when i try add lumen validator custom rule
When i have error on this part of code
$validator = Validator::make($request->all(), [
'code' => 'nullable|string',
'phone' => 'required|string|numbers'
]);
...
0
votes
0
answers
34
views
Post request with Guzzle to sending email with queue not working
I developed send email service(with queue) with Laravel lumen. That's working fine with Postman.
When I request that service from another Laravel application with Guzzle post request, reach to API ...
0
votes
0
answers
40
views
ErrorException - Trying to access array offset on value of type null in ServiceProvider.php line 84 in Lumen
I am new to Lumen so I just downloaded and installed a fresh lumen setup but unfortunately as soon as I hit postman it sends me above error. I have read many posts all says to use isset() i did so but ...
0
votes
1
answer
9
views
Use Lumen framework to insert Chinese character
I am using Lumen framework to provide API for my main site.
A URI to insert a tag looks like this:
$router->get('/addtag/{id}/{tag}', 'BookController@addTag');
When tag is Chinese, it was inserted ...
0
votes
0
answers
10
views
I am new to Lumen, Can some one tell me how to set up FTP in lumen. I have tried with below code set up but it is not working at my end
I am using lumen 9.0.
$response = Storage::disk('ftp')->put('path-to-remote-server', $fileContent)
In $response i am getting 1(true) as response but file is not uploading to remote server.
My ...
0
votes
2
answers
54
views
How to return json response in Laravel using eloquent without \r\n
I'm using laravel with eloquent and in json response i get \r\n. How can i get rid of them?
public function showOneProduct($lng)
{
return response()->json(Product::where('language', $lng)->get(...
0
votes
0
answers
38
views
Bearer Token issue on Nginx
Facing an issue on Bearer Token verification on Nginx
enter image description here
with following configuration:
server {
listen 80 ;
listen [::]:80 ;
root /var/www/html/public;
\
...
1
vote
0
answers
13
views
Heroku PHP continue process execution after sending a response
I have a code which runs a light background task after returning an ok 200 response to the request.
The code runs fine on most apache servers and it was running on heroku but stopped recently, the ...
0
votes
1
answer
43
views
Lumen changes table name in query
I'm new to Lumen (ver. 8.3.4) and I got a strange issue during my tests.
In my DB I have the table "Pippo"; to query it I created the model App\Models\Pippo and the controller App\Http\...
0
votes
1
answer
31
views
PHP Fastroute - Handle 404s
In my application I'm using FastRoute and I would like to have different types of 404 responses:
When a call is made to a not existing endpoint starting with /api then the application should return a ...
-1
votes
1
answer
29
views
How to set API Rate Limiting for every user in Lumen?
I have an API in the Lumen framework and I need to set a limit to calling this API for every user_id.
So I need to limit calling this API just once per minute.
0
votes
0
answers
26
views
How to run GRAPHQL query using laravel lumen suing concurrent request
i'm running graphql query through array in Laravel postAsyn. any solution for that. below i added graphql query.
$client = new Client([
// Base URI is used with relative requests
'base_uri' => $...
0
votes
0
answers
20
views
Database connection [mysql2] not configured when i upload in docker
I am using two databases connection in local it is working when I
upload in docker it is showing the error
```
'mysql' => [
'driver' => 'mysql',
'host' => env('...
0
votes
1
answer
23
views
How can I get and print/log the currently installed exact version number of Lumen?
As I mentioned in the Q-title, I want to print/log the currently installed version of Lumen framework i.e. the exact version number of Lumen thro' Bash script in GitBash terminal or PHP snippet in any ...
0
votes
1
answer
25
views
Cannot test validation errors in Lumen
When i try to validate controller response using one of the available assertions like assertJsonValidationErrors it gives the following error:
Failed to find a validation error in the response for key:...
0
votes
0
answers
30
views
laravel lumen cursorPaginate error when OrderBy is 0
I have a problem with cursorPaginate
When I arrange the data using orderBy, the pages arrive until the number is zero
for example
Any::OrderByDesc('views')->cursorPaginate();
The Sql Code
...
0
votes
0
answers
27
views
Laravel Passport multi auth always falling back to my default guard
I'm currently moving an app from Laravel/lumen 6 to Laravel/Lumen8.
Previously I was using this package https://github.com/sfelix-martins/passport-multiauth to handle multi auth.
Now that Laravel ...
0
votes
0
answers
46
views
Delete item in array PHP
I'm doing a REST api with Lumen framework.
One api call give me all my categories of product :
{
"categories": [
{
"id": 1,
"name": &...
0
votes
1
answer
66
views
How to query (sql) by listing the sports of the player doesn't belong to?
sports table
id
sport name
1
basketball
2
volleyball
3
golf
4
baseball
players table
id
sport name
1
michael
2
stephen
player sports table
id
player_id (players.id)
sport.id (sports.id)
1
...
0
votes
0
answers
40
views
Laravel + Lumen : save image to storage
if I have Laravel project save images in storage like this :
public function storeImage()
{
$this->orderimage->storePubliclyAs('images',$this->ordercusID.str_replace('-', '', now()...
0
votes
0
answers
23
views
Where to filter entities in API response with Lumen?
I have a gallery entity with accompanying gallery contents. Some of the contents are not yet approved for ordinary user.
On which level is most optimal, to filter out contents that are not approved?
...
0
votes
0
answers
54
views
adding api routes for roles and permssions to existing lavarel lumen project
<?php
namespace App\Models;
use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\Authenticatable as ...
0
votes
0
answers
47
views
Configure PHP/Apache (Lumen Project), MySQL ECR containers on AWS EC2 (Fargate)
I have uploaded container images for PHP/Apache (Lumen Project) & MySQl to AWS ECR successfully from my local development environment.
I am using Docker Desktop 4.5.1 (74721) on Windows 10.
But ...
0
votes
0
answers
26
views
How to Flatten data along with key in Lumen/Laravel
I followed this tutorial. It was worked. How to get json to flatten along with key in lumen/laravel. I need key and value.
Code I used:
public function index(){
$collection = collect([
'name' =...
0
votes
2
answers
30
views
How to delete photo from project's public folder before updating data in lumen/laravel?
I am trying to delete photo from my projects public folder before updating another photo. My code looks like-
if(File::exist( $employee->avatar)){
//$employee->avatar looks /uploads/...
0
votes
0
answers
85
views
How to use chunk() in Laravel for progress and failure updates?
Laravel Eloquent Model called ProductModel that references a table that contains a large number of rows (i.e. 500,000). Each row contains a product_id that calls the function isValid() which either ...
0
votes
0
answers
19
views
Lumen "The requested resource was not found on this server." Error
Problem: Images are not showing in Lumen-vue project.
This question may seems a bit long. But I tried to make it visual easily.
In my lumen(8.3.4) server, I'm using a standalone vue frontend, and ...
0
votes
1
answer
69
views
How do i track an order using laravel lumen?
I'm integrating APIs that will be connected to an E-Commerce platform. I'm supposed to add an option to track orders, how do I do that?
Also, there's no frontend yet so I'm using postman to test all ...
1
vote
1
answer
153
views
laravel/passport for laravel lumen support
Currently i'm using laravel lumen version 8 for API and i want to integrate laravel/passport for OAuth authorization for the API but when i try to install laravel/passport i get the following error ...
0
votes
0
answers
10
views
Downloading file from storage folder not working
I'm trying to download pdf file from public folder in my lumen 8 application. The exact file path is public/assets/attachments/resume.pdf. My code is
public function downloadResume()
{
return ...
0
votes
1
answer
73
views
Processing events in Lumen from another Laravel project on same DB
I'm working on a Laravel 8 project, and have a Laravel Lumen 8 project sitting along side my Laravel project. Both connect to the same database, and the database has the jobs and failed_jobs table.
...
0
votes
1
answer
24
views
How to implement Depedency Injection correctly when injected service has required constructor argument
I am using Laravel Lumen (v8.2.4) with PHP (v7.4)
I have the following controller class:
<?php
namespace App\Http\Controllers;
use App\Services\MyService;
class MyController extends Controller
{
...
0
votes
0
answers
15
views
Sort belongsToMany relation base on field in belongTo relation Laravel Eloquent
I have a scenario where User has a belongsToMany relation with PortalBreakdown, PortalBreakdown has a belongsTo relation with Portal. Portal has order column in it. I have a method listing_quota($id) ...
0
votes
0
answers
65
views
Target class [blade.compiler] does not exist. in Lumen can we use balde in lumen provider
In Lumen can we use Blade in the Lumen provider?
Target class [blade.compiler] does not exist.
namespace App\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
...
0
votes
1
answer
25
views
Delete current database in MongoDB using Jessenger / Lumen
I am using Jessenger in Lumen for handling MongoDB.
I have a scenario where I need to delete/drop the current database.
For example, in mongo db, I am executing the following queries.
use '367';
db....
0
votes
1
answer
740
views
how to make laravel 9 api-only?
Is there a way to make laravel api-only?(for optimized speed)
I wanted to use lumen but it's not listed in the laravel docs anymore. Is there anyway to achive this?
0
votes
1
answer
154
views
Lumen v9 missing php artisan schedule command
in lumen v8 I had access to artisan schedule:* commands.
After upgrading lumen to v9:
"laravel/lumen-framework": "^9",
The artisan command console is missing the artisan schedule:*...
1
vote
1
answer
65
views
Lumen migration - Foreign Id with a table name that isn't the plural of the local key
How can I create a Lumen migration with a column that references a table that has an unrelated name to the column name?
Example:
The following would throw an error that user_destinations can't be ...
0
votes
1
answer
211
views
Handle multiple requests in Guzzle between two Laravel projects at same time
I'm working in two projects, a Laravel 8 project and a Laravel Lumen 8 project, both of which use Guzzle to make HTTP requests, they're running on the following domains:
Laravel 8 http://localhost:...
0
votes
0
answers
114
views
Laravel Lumen Guzzle times out with no obvious reason why, error code 28 curl
I'm currently working on a Laravel 8 project, I have two projects:
A Laravel 8 project used as an API, it exposes some endpoints
A Laravel Lumen 8 project which runs on it's own domain.
Both have ...
0
votes
1
answer
34
views
PHP PDO returning no records but SSMS does for the same SQL query
I have a conundrum that appears to defy logic, involving Lumen, PHP, PDO, and SQL Server.
I have a controller which contains an action, that executes a stored procedure on a QL Server instance before ...
0
votes
2
answers
32
views
Result of an SQL inside the item with $appends
I have the following files:
LicensesController.php:
namespace App\Http\Controllers;
use App\Models\License;
class LicencesController
{
public function showLicense()
{
return License:...