laravel-admin-extensions / api-tester Goto Github PK
View Code? Open in Web Editor NEWAPI tester for laravel-admin
Home Page: http://laravel-admin.org/
License: MIT License
API tester for laravel-admin
Home Page: http://laravel-admin.org/
License: MIT License
<form action="#" method="post"><div class="input-group"><input type="text" name="message" placeholder="Type Url ..." class="form-control filter-routes"><span class="input-group-btn"><button type="button" class="btn btn-primary btn-flat"><i class="fa fa-search"></i></button></span></div></form>
搜索栏按按钮不能提交,回车键便会POST,报错
Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
No message
protected function methodNotAllowed(array $others)
{
throw new MethodNotAllowedHttpException($others);
}
I got error while trying to install api-tester on Laravel-admin 1.8.*
Problem 1 - Installation request for laravel/framework (locked at v6.18.26, required as ^6.2) -> satisfiable by laravel/framework[v6.18.26]. - Installation request for laravel-admin-ext/api-tester ^1.0 -> satisfiable by laravel-admin-ext/api-tester[v1.0, v1.0.1, v1.0.2]. - Can only install one of: encore/laravel-admin[1.5.x-dev, v1.8.1]. - Can only install one of: encore/laravel-admin[v1.8.1, 1.5.x-dev]. - Can only install one of: encore/laravel-admin[1.5.x-dev, v1.8.1]. - Conclusion: install encore/laravel-admin 1.5.x-dev - Installation request for encore/laravel-admin 1.8.1 -> satisfiable by encore/laravel-admin[v1.8.1].
希望 config 中增加上传文件开关、Login as 开关,使 api-tester 权限更可控扩展使用范围。十分感谢!
我在路由中定义了一个 options 的路由 ,在打开 api-test 模块后报错 Undefined index: OPTIONS
vendor/laravel-admin-ext/api-tester/src/ApiTester.php
public static $methodColors = [
'GET' => 'green',
'HEAD' => 'gray',
'POST' => 'blue',
'PUT' => 'yellow',
'DELETE' => 'red',
'PATCH' => 'aqua',
];
vendor/laravel-admin-ext/api-tester/resources/views/index.blade.php
@foreach($routes as $route)
@php ($color = Encore\Admin\ApiTester\ApiTester::$methodColors[$route['method']])
<li class="route-item"
data-uri="{{ $route['uri'] }}"
data-method="{{ $route['method'] }}"
data-method-color="{{$color}}"
data-parameters='{!! $route['parameters'] !!}' >
<a href="#"><b>{{ $route['uri'] }}</b>
<div class="pull-right">
<span class="label bg-{{ $color }}">{{ $route['method'] }}</span>
</div>
</a>
</li>
@endforeach
this package has compatibility issues since Laravel 6.x, and now Laravel 7.x either. If this package is no longer maintained I would remove it forever from my project.
At lines 33, 34, 42 of src/ApiTesterCotroller.php and 268 of src/ApiTester.php function array_get is used. It breaks in any versions of Laravel newer than 6.0. It's fixed by replacing it with function Arr:get (and adding "use Illuminate\Support\Arr;").
I would make a new branch for newer versions of Laravel, but I'm too shit with git to make a proper pull request
api/user
InvalidArgumentException
Route [login] not defined.
protected function methodNotAllowed(array $others)
{
throw new MethodNotAllowedHttpException($others);
}
config里
'user_retriever' => function ($id) { return \App\User::find($id); }
php artisan config:cache 会报错,config里不能用closure。
然后API auth driver 用的是passport,没有retrieveById 函数
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.