# Laravel **Repository Path**: chenh90/laravel ## Basic Information - **Project Name**: Laravel - **Description**: Laravel后台管理系统 - **Primary Language**: PHP - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 4 - **Forks**: 2 - **Created**: 2018-06-22 - **Last Updated**: 2025-07-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Laravel =============== ### 安装 ~~~ composer create-project laravel/laravel=6.* laravel6 ~~~ #### 扩展包 1.安装PhpSpreadsheet扩展 (Excel) ~~~ composer require phpoffice/phpspreadsheet ~~~ 2.安装qrCode扩展 ~~~ composer require endroid/qr-code ~~~ 3.安装JWT扩展 (JwtAuth) ~~~ composer require tymon/jwt-auth 1.0.0-rc.5 ~~~ ## 1. TCA 配置: ``` // text 'yourfield' => [ 'label' => trans('yourmodel.yourfield'), 'type' => 'text', 'search' => true, 'advancedSearch' => true, 'showAsColumn' => true, 'size' => 12, 'editable' => true, 'addable' => true, 'align' => 'center', 'disabled' => true, 'sortable' => true, 'showAsColumn' => [ 'label' => 'Your custom column label', 'width' => '5%', 'mapping' => [ 'key1' => 'value1', 'key2' => 'value2' ], 'align' => 'center' ] ] // select 'yourfield' => [ 'label' => trans('yourmodel.yourfield'), 'type' => 'select', 'search' => true, 'advancedSearch' => true, 'showAsColumn' => true, 'size' => 12, 'editable' => true, 'addable' => true, 'data' => [ 'key1' => 'value1', 'key2' => 'value2', ], 'disabled' => true, 'sortable' => true ] // h3 'yourfield' => [ 'label' => trans('yourmodel.yourfield'), 'type' => 'h3', 'size' => 12, ] ``` ## 2. 高级搜索配置 ``` // status advancedSearch 'advancedSearch' =>[ 'type' => 'checkbox', 'data' => [ '_all_' => [ 'label' => trans('common.status.all'), 'class' =>'all', ], 1 => [ 'label' => trans('common.status.activated'), 'class' => 'activated', ], 2 => [ 'label' => trans('common.status.deactivated'), 'class' => 'deactivated', ] ], 'size' => 12 ] ``` ## 3. 状态字段 ``` // default status is the first data 'status' => [ 'label' => trans('common.status'), 'type' => 'status', 'data' => [ 1 => [ 'label' => trans('common.status.activated'), 'class' => 'activated' ], 2 => [ 'label' => trans('common.status.deactivated'), 'class' => 'deactivated' ] ], 'showAsColumn' => '5%', 'sortable' => true ], ``` ## 4. Model ## ``` class YouModelName extends Base { /** * Get TCA config * @return array */ public function getTCA() { return [ 'pageSize' => '10, 20, 50', //default order by 'defaultSorting' => [ 'sorting' => 'asc', 'id' => 'asc' ], 'defaultWhere' => 'a.id > 0', 'columns' => [ // headline '--div1--' => [ 'type' => 'h3', 'size' => 12, 'label' => 'test' ], // text 'id' => [ 'label' => Common::trans('id'), 'type' => 'hidden', 'disabled' => true, 'showAsColumn' => '5%', 'sortable' => true //can be sort in list view ], //... more fields ] ] } } ```