Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

options 颜色列表不存在导致的 bug #9

Open
yunlongw opened this issue Sep 26, 2019 · 0 comments
Open

options 颜色列表不存在导致的 bug #9

yunlongw opened this issue Sep 26, 2019 · 0 comments

Comments

@yunlongw
Copy link

我在路由中定义了一个 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant