Questions tagged [lumen-routing]
13 questions
15
votes
4 answers
Just installed Lumen and got NotFoundHttpException
I'm searching for a solution ... it's getting so frustrating.
After a fresh installation of Lumen by Laravel, I simply can't access the "/" route. When I try to, it throws an error:
NotFoundHttpException in RoutesRequests.php line 443:
in…

robertsan
- 1,591
- 3
- 14
- 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
4
votes
1 answer
Route with dot (IP address) not found, returns 404
I use Lumen 5.4.
This is how my route is setup:
$app->get('/ip/{ip}', GeoIpController::class . '@show');
The {ip} route parameter should be an IP address, with dots in it. However, it seems there is a problem when a route has dots in it. It…

wujt
- 1,278
- 2
- 13
- 21
2
votes
1 answer
How to exclude "/api" from "any"-route in Lumen router (per regex)?
I have a problem with the Lumen router (web.php):
My project includes vue.js with the vue router, so I want to point all routes to the router, what is indeed working fine.
$router->get('{path:.*}', function () {
return view('app');
});
My…

zero2579
- 218
- 2
- 8
2
votes
0 answers
New version of Lumen causes route to return Undefined Offset error
Using Lumen 5.4.5.
I recently tried out a dated Lumen tutorial from 2015 (http://loige.co/developing-a-web-application-with-lumen-and-mysql/) with the latest version of Lumen. For the most part, everything from this tutorial which was written for a…

sparecycle
- 2,038
- 5
- 31
- 58
2
votes
1 answer
Lumen route group doesn't work with named route
When I define a route inside a group in Lumen framwork it's working well with a direct closure but not with a controller name ; I always get a not found exception.
//Working
$app->group(['prefix' => 'admin'], function () use ($app) {
…

Antoine Bellion
- 136
- 1
- 9
2
votes
1 answer
Lumen installation error
I am trying to install lumen with composer so I used the command below
composer create-project --prefer-dist laravel/lumen api
But, for some reason I am getting this error before even doing anything, just visiting the public folder.
Sorry, the page…
user4748790
2
votes
1 answer
Using Route Prefixes in Lumen
From the Lumen 5.2 docs:
The prefix group attribute may be used to prefix each route in the
group with a given URI. For example, you may want to prefix all route
URIs within the group with admin:
$app->group(['prefix' => 'admin'], function ()…

Joseph
- 2,737
- 1
- 30
- 56
1
vote
2 answers
How to get routes and namespace in Lumen 5.2?
Lumen 5.2 has not been officially released yet, but as you can see in the GitHub repository the methods app()->getRoutes() and app()->getNamespace() will be no longer available.
Are there any other ways to get the routes and the namespace in Lumen…

Koga
- 555
- 1
- 5
- 18
0
votes
1 answer
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\Controllers\PippoController.php, that includes the…

Gianluca
- 139
- 5
0
votes
1 answer
The route() function in Lumen with a regex route parameter return a false url
In Lumen micro framework, i created a simple route with a date as parameter (ie: /2018-02-31).
$router->get(
'{from:\d{4}(?:-\d{1,2}){2}}',
[
'as' => 'date',
function($from) use ($router) {
return $from;
…

Thomas Bihan-Poudec
- 165
- 8
0
votes
2 answers
Seeing only the app version with Lumen POST API call
I am new to Lumen. I started using Lumen on MAC OS and running it inside a docker container.
The app service in the dockerfile is as follows:
app:
build:
context: ./
dockerfile: app.dockerfile
working_dir: /var/www
volumes:
-…

deGee
- 781
- 1
- 16
- 34
0
votes
2 answers
Lumen: How to delete a record from DB?
Using Lumen, I'm displaying "Tickets". Here's my Tickets.blade.php:
@foreach($tickets as $ticket)
{{ $ticket->id }}
{{ $ticket->content }}