laravel-api-tester icon indicating copy to clipboard operation
laravel-api-tester copied to clipboard

Missing required parameters in Laravel 6

Open timoteo7 opened this issue 4 years ago • 7 comments

i am using Laravel 6,

after register ServiceProvider i get :

Missing required parameters for [Route: api-tester.file] [URI: api-tester/assets/{_file}]. (View: ...../vendor/asvae/laravel-api-tester/resources/views/api-tester.blade.php)

timoteo7 avatar Mar 04 '20 12:03 timoteo7

It's the same for the Laravel 7...

martio avatar Mar 23 '20 19:03 martio

here also same issue for version 6.1

GhulamRasoolNunari avatar Mar 30 '20 10:03 GhulamRasoolNunari

still has the same issue for version 6.2

Batur24 avatar Apr 03 '20 06:04 Batur24

Sorry, don't have time to fix that at the moment.

PR is very welcome though. Thanks.

asvae avatar Apr 03 '20 17:04 asvae

here what i found after carefully reading core files of api-tester, and it works for me in laravel version > 5.8 you need to change some files in vendor\asvae\laravel-api-tester folder

Step 1: first of all open vendor\asvae\laravel-api-tester\resources\views\api-tester.blade.php and replace some code From: <link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['file' => 'api-tester.css']) }}"> To: <link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['_file' => 'api-tester.css']) }}">

also need to do some more in same file:

From: <script src="{{ route('api-tester.file', ['file' => 'api-tester.js']) }}"></script> To: <script src="{{ route('api-tester.file', ['_file' => 'api-tester.js']) }}"></script>

Step 2: if you are not running your system on PHP v7.4 then skip the step 2 open vendor\asvae\laravel-api-tester\src\Storages folder and find JsonStorage.php on line # 57 Replace the code

From: $this->path = implode($path,'/');

To: $this->path = implode('/',$path);

Step 3:

open vendor\asvae\laravel-api-tester\src\Entities folder and find RouteInfo.php on line # 190 Replace the code

From:

if (is_string($uses) && str_contains($uses, '@')) {

To: if (is_string($uses) && Str::contains($uses, '@')) {

also dont forget to add below line at top of the page use Illuminate\Support\Str; that's it Now enjoy with your output.

safiullahsarhandi avatar Apr 07 '20 14:04 safiullahsarhandi

here what i found after carefully reading core files of api-tester, and it works for me in laravel version > 5.8 you need to change some files in vendor\asvae\laravel-api-tester folder

Step 1: first of all open vendor\asvae\laravel-api-tester\resources\views\api-tester.blade.php and replace some code From: <link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['file' => 'api-tester.css']) }}"> To: <link media="all" type="text/css" rel="stylesheet" href="{{ route('api-tester.file', ['_file' => 'api-tester.css']) }}">

also need to do some more in same file:

From: <script src="{{ route('api-tester.file', ['file' => 'api-tester.js']) }}"></script> To: <script src="{{ route('api-tester.file', ['_file' => 'api-tester.js']) }}"></script>

Step 2:

open vendor\asvae\laravel-api-tester\src\Storages folder and find JsonStorage.php on line # 57 Replace the code

From: $this->path = implode($path,'/');

To: $this->path = implode('/',$path);

Step 3:

open vendor\asvae\laravel-api-tester\src\Entities folder and find RouteInfo.php on line # 190 Replace the code

From:

if (is_string($uses) && str_contains($uses, '@')) {

To: if (is_string($uses) && Str::contains($uses, '@')) {

also dont forget to add below line at top of the page use Illuminate\Support\Str; that's it Now enjoy with your output.

it works for me, thanks bro.

GhulamRasoolNunari avatar Apr 07 '20 14:04 GhulamRasoolNunari

Thank you,it works

yezid00 avatar Jun 11 '20 01:06 yezid00