laravel-api-tester
laravel-api-tester copied to clipboard
Missing required parameters in Laravel 6
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)
It's the same for the Laravel 7...
here also same issue for version 6.1
still has the same issue for version 6.2
Sorry, don't have time to fix that at the moment.
PR is very welcome though. Thanks.
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.
here what i found after carefully reading core files of api-tester, and it works for me in
laravel version > 5.8you need to change some files invendor\asvae\laravel-api-testerfolder
Step 1:first of all openvendor\asvae\laravel-api-tester\resources\views\api-tester.blade.phpand 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\Storagesfolder and findJsonStorage.phpon line # 57 Replace the codeFrom:
$this->path = implode($path,'/');To:
$this->path = implode('/',$path);Step 3:
open
vendor\asvae\laravel-api-tester\src\Entitiesfolder and findRouteInfo.phpon line # 190 Replace the codeFrom:
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.
Thank you,it works