4.3. 后台众筹商品管理

本教程最新版为 8.x,当前版本已放弃维护,请阅读最新版本!

后台众筹商品管理

上一节我们完成了众筹商品相关的数据库调整,这一节我们将要来实现众筹商品的后台管理功能。

1. 创建控制器

由于众筹商品的字段与普通商品不同,因此需要创建一个新的管理后台控制器:

$ php artisan admin:make CrowdfundingProductsController --model=App\\Models\\Product

app/Admin/Controllers/CrowdfundingProductsController.php

<?php

namespace App\Admin\Controllers;

use App\Models\Category;
use App\Models\CrowdfundingProduct;
use App\Models\Product;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;

class CrowdfundingProductsController extends AdminController
{
    protected $title = '众筹商品';

    protected function grid()
    {
        $grid = new Grid(new Product);

        // 只展示 type 为...

本文章首发在 LearnKu.com 网站上。

为了保证课程的高品质,我们需要对课程进行收费。付费后 才能观看剩余内容。 购买

上一篇 下一篇
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0

暂无话题~