Closed lloricode closed 4 years ago
Solution is to create a class something like Dingo\Api\Http\LumenRequest
then it extend on Laravel\Lumen\Http\Request
to make compatible in lumen
instead of Illuminate\Http\Request
when using lumen, because Laravel\Lumen\Http\Request
already extend in Illuminate\Http\Request
@specialtactics
hi, how can we totally adopt lumen request here? I see the code of dingo api, it seems it totally for extended in laravel?
or need to separate this with lumen request
I got this exception when running a test
{"message":"Argument 1 passed to Dingo\\Api\\Http\\RateLimit\\Handler::rateLimitRequest() must be an instance of Dingo\\Api\\Http\\Request, instance of Laravel\\Lumen\\Http\\Request given, called in \/home\/vagrant\/code\/laravels\/api\/kimberly-api-pwa\/vendor\/dingo\/api\/src\/Http\/Middleware\/RateLimit.php on line 64","status_code":500}"
/**
* @test
*/
public function show404()
{
$this->get('blocks/xxx', $this->addHeaders())
->assertResponseStatus(404);
$this->get('blocks/xxx/xxx', $this->addHeaders());
dd($this->response->getContent());
// ->assertResponseStatus(404);
$machineName = Block::first()->machine_name;
$this->get('blocks/xxx/' . $machineName, $this->addHeaders())
->assertResponseStatus(404);
}
because lumen on testing is using Laravel\\Lumen\\Http\\Request
Sorry, I am not too sure as I do not use Lumen. I think you will find that Lumen is not used much nowdays (especially for new projects) - so the best advice I can give is to switch your project to Laravel - as I am aware of a few weird issues with Lumen and Dingo, and I myself don't have the Lumen experience to look at them.
hmm, maybe minor adjustment because we much need lumen because we use it for pure api,
thanks @specialtactics i will find solution for this
@lloricode You will find you can use Laravel for pure API just as easily nowdays, and with deferred providers there is not much of any advantage to lumen like there was when it first came out.
At the same time the feature sets between Lumen and Laravel routing are becoming too great which causes other problems, and hence the issues between dingo and lumen.
yes i see i will try recreate our existing lumen to a new laravel, and observe if we got same result, thanks for idea, maybe i should close this, because it clearly to me
thanks @specialtactics
@specialtactics let me find solution, please give me more time ☺️, i will stay this open as a progress in my side
Sure it's no problem, I will assign the issue to you :smile:
@lloricode So what did you do? I'm not really in the mood to spend hours on a Lumen/dingo api project, to then come to the conclusion I have to rewrite it in Laravel ^^
@pixeliner try this https://github.com/lloricode/lumen-dingo-boilerplate
Actual Behaviour
I have a route
Inside controller
Then requesting
Then the result give error
This is work while dingo not install
Expected Behaviour
I expected to get the value from url named
{id}
Steps to Reproduce
make a route like this
then get it on constructor