Voyager管理面板中“用户”页面上的错误

时间:2019-12-02 22:43:05

标签: php laravel voyager

我在“用户”页面上收到此错误

  

get_class()期望参数1为对象,给定字符串(查看:   ../vendor/tcg/voyager/resources/views/bread/partials/actions.blade.php)   (视图:   ../ vendor / tcg / voyager / resources / views / bread / partials / actions.blade.php)

enter image description here

我对此没有做任何事情。它一直在工作,然后突然引发错误。有什么想法吗?

PHP:7.2 Laravel:6.0 旅行者:最新 在本地主机上工作

更新: 这是actions.blade.php-默认旅行者的文件,错误提示问题出在$ class = get_class($ action);

@if($data)
    @php
        // need to recreate object because policy might depend on record data
        $class = get_class($action);
        $action = new $class($dataType, $data);
    @endphp
    @can ($action->getPolicy(), $data)
        <a href="{{ $action->getRoute($dataType->name) }}" title="{{ $action->getTitle() }}" {!! $action->convertAttributesToHtml() !!}>
            <i class="{{ $action->getIcon() }}"></i> <span class="hidden-xs hidden-sm">{{ $action->getTitle() }}</span>
        </a>
    @endcan @elseif (method_exists($action, 'massAction'))
    <form method="post" action="{{ route('voyager.'.$dataType->slug.'.action') }}" style="display:inline">
        {{ csrf_field() }}
        <button type="submit" {!! $action->convertAttributesToHtml() !!}><i class="{{ $action->getIcon() }}"></i>  {{ $action->getTitle() }}</button>
        <input type="hidden" name="action" value="{{ get_class($action) }}">
        <input type="hidden" name="ids" value="" class="selected_ids">
    </form>
@endif

0 个答案:

没有答案