Closed oleynikd closed 9 years ago
@oleynikd could be result of your controller?
I just tested this in my route.
Try referencing it to a plain vanilla controller.
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
class AuthController extends Controller
{
public function postRegister(Request $request)
{
return $request->all();
}
}
I tried plain vanilla controller - that did not helped.
I'm also using laravel/spark... Not sure if this changes something?
I am having the same problem. If I change the controller to a class that does not exists it throws an error, but it does not register the method when set correctly.
@oleynikd not sure if it is supported at this time. Current support is Laravel 5.1+ or Lumen 5.1+ from what I understand. Best create a test case with plain vanilla?
My problem seemed to be with subdomain vs domain. You can not set your subdomain equal to the domain. That is as far as I have got. Begs the question what if you want an API on its own domain?
I also have my API on separate subdomain using API_DOMAIN env variable, but removing it did not helped.
I tried new plain installation of laravel and dingo/api - result is the same!
Here's the simple repo to illustrate the issue: https://github.com/oleynikd/laravel-dingo-routes-test There are 3 commits to describe changes I made. If I do:
git clone https://github.com/oleynikd/laravel-dingo-routes-test.git
cd laravel-dingo-routes-test/
composer install
php artisan api:route
I get:
Hope this will help.
P.S. If you skip this step:
php artisan vendor:publish --provider="Dingo\Api\Provider\LaravelServiceProvider"
after dingo\api
installation you'll get:
[ErrorException]
Argument 2 passed to Dingo\Api\Exception\Handler::__construct() must be of the type array, null given, called in .../vendor/dingo/api/src/Provider/ApiServiceProvider.php on line 125 and defined
But on Wiki page this step is described as optional...
Thanks.
Just pushed a fix.
As for the exception you're see @oleynikd, place the API service provider above the application ones. That way everything is being registered and booted before your application providers are registered and booted. Will mention this in documentation.
Thank you @jasonlewis
Hi,
First of all thank you for such a great tool!
Here's my route:
And here's the result of
php artisan api:routes
:Why is Action = Closure?
I'm using:
Thanks.