PHP code example of hooyee / laravel-vue-admin

1. Go to this page and download the library: Download hooyee/laravel-vue-admin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hooyee / laravel-vue-admin example snippets


use SmallRuralDog\Admin\Controllers\AdminController;
use SmallRuralDog\Admin\Controllers\AdminResource;

class GroupBuyController extends AdminController implements AdminResource
{

    //表格定义
    public function grid()
    {
        $grid = new Grid(new GroupBuyGoods());
        $grid->column('goodsSku.image')->align("center")->component(Image::make()->size(50, 50));
        $grid->column('goodsSku.name');
        $grid->column('group_buy_number')->width(90)->align('center');
        $grid->column('group_buy_price')->width(90)->align('center')->itemPrefix("¥");
        $grid->column('start_time')->width(190);
        $grid->column('end_time')->width(190);
        return $grid;
    }

    //表单定义
    public function form($isEdit = false)
    {
        $form = new Form(new GroupBuyGoods());
        $form->item('name');
        $form->item('group_buy_number')->

 $router->resource('GroupBu', 'GroupBuyController');
 bash
php artisan vendor:publish --provider="SmallRuralDog\Admin\AdminServiceProvider"
 bash
php artisan admin:install
bash
// 发布静态资源文件(必须)
php artisan vendor:publish --tag=laravel-vue-admin-assets --force
bash
// 发布语言包文件
php artisan vendor:publish --tag=laravel-vue-admin-lang --force

// 清理视图缓存
php artisan view:clear