laravel-request-docs: Issues : $docs is undefined & ReflectionException

Hello,

I have recently installed this library and I cannot get it to work since version 2.X, previous versions worked (but I want v2, it’s clearly better)

I have correctly plublished the config file and cached the routes (and didn’t touched the config file).

- Issue 1

When I load the /request-docs URL I land on this error (cf image 1).

image

Undefined variable: docs (View: /mnt/c/Users/...../vendor/rakutentech/laravel-request-docs/resources/views/index.blade.php)

- Issue 2

With /request-docs/api I get this error (cf image 2)

image

Class O:47:"Laravel\SerializableClosure\SerializableClosure":1:{s:12:"serializable";O:46:"Laravel\SerializableClosure\Serializers\Signed":2:{s:12:"serializable";s:262:"O:46:"Laravel\SerializableClosure\Serializers\Native":5:{s:3:"use";a:0:{}s:8:"function";s:44:"function () { return \view('welcome'); }";s:5:"scope";s:37:"Illuminate\Routing\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"00000000796b2b380000000015e6114a";}";s:4:"hash";s:44:"07FpsRzZ6atDqBGWAj0Izt3NNHZbdd5/Tmsem1AUHa0=";}} does not exist

I’ve already tried to reinstall the package, tweak some parameters and to clear the config and cache but nothing works. The issues are probably linked together.

Some environment information

"rakutentech/laravel-request-docs": "^2.11"
Laravel version 8.83.27
Laravel locale fr
Laravel config cached false
PHP version 7.4.33

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Let me check with HR first in order to provide you with appropriate details on that.

About the horizontal scroll. Actually they need to be fixed. I wasn’t able to fix that part of table css actually as word wrap and word break

Lol scrollbars need a style? I ll put some John Vick themed style.

@Julien-cpsn

Yes, please use the new version 2.12. Thank you for using Laravel Request Docs.

Hello!

I did create a new projet with the following steps:

composer create-project laravel/laravel:^8.0 test-docs
cd test-docs/
composer require rakutentech/laravel-request-docs
php artisan vendor:publish --tag=request-docs-config
php artisan route:cache
php artisan serve

The first issue is resolved on this new projet but the 2nd one remains!

Here are the screenshots: image image

ReflectionException
Class O:47:"Laravel\SerializableClosure\SerializableClosure":1:{s:12:"serializable";O:46:"Laravel\SerializableClosure\Serializers\Signed":2:{s:12:"serializable";s:295:"O:46:"Laravel\SerializableClosure\Serializers\Native":5:{s:3:"use";a:0:{}s:8:"function";s:77:"function (\Illuminate\Http\Request $request) { return $request->user(); }";s:5:"scope";s:37:"Illuminate\Routing\RouteFileRegistrar";s:4:"this";N;s:4:"self";s:32:"00000000759cddfc000000006fc2ef19";}";s:4:"hash";s:44:"P5iaQBSB8QFLq0Od+WejRKPCx5EMwkYZAthqdwxT3Fs=";}} does not exist

http://127.0.0.1:8000/request-docs/api?groupby=default&json=true&showDelete=true&showGet=true&showHead=true&showPatch=true&showPost=true&showPut=true&sort=default

btw I created a minimal controller and route as follow but it does not appear on api list (cf screenshot 1), it is probably linked to the 2nd issue

class TestController extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests;

    public function getSomeData(Request $request) {
        $data = [
            "value1" => 0,
            "value2" => [
                'a',
                'b',
                'c'
            ]
        ];

        return \response($data);
    }
}
Route::get('test', [TestController::class, 'getSomeData']);