1
我想擴展Backpack \ NewsCRUD \ app \ Http \ Controllers \ Admin \ ArticleCrudController,以便我可以添加一個新字段。但它並沒有顯示出一個新的領域。我在這裏做錯了什麼?擴展揹包管理ArticleCrudController
namespace App\Http\Controllers\Admin;
use Backpack\NewsCRUD\app\Http\Controllers\Admin\ArticleCrudController as OriginalArticleCrudController;
class ArticleCrudController extends OriginalArticleCrudController
{
public function __construct()
{
parent::__construct();
$this->crud->addField([
'name' => 'thumb',
'label' => 'Thumb',
'type' => 'browse',
]);
}
}
看來resources/vendor/backpack/base/inc/sidebar.php
中的鏈接沒有指向這個新的ArticleCrudController。
<ul class="treeview-menu">
<li><a href="{{ url('admin/article') }}"><i class="fa fa-newspaper-o"></i> <span>Articles</span></a></li>
<li><a href="{{ url('admin/category') }}"><i class="fa fa-list"></i> <span>Categories</span></a></li>
<li><a href="{{ url('admin/tag') }}"><i class="fa fa-tag"></i> <span>Tags</span></a></li>
</ul>