xn/laravel-admin

v1.0.55 2024-04-26 17:35 UTC

README

laravel-admin

laravel-admin is administrative interface builder for laravel which can help you build CRUD backends just with few lines of code.

Documentation | 中文文档 | Demo | Demo source code | Extensions

Build Status StyleCI Packagist Total Downloads Awesome Laravel badge.svg?style=flat-square Donate-Paypal-green.svg?style=flat-square

</a> 

Inspired by SleepingOwlAdmin and rapyd-laravel.

Requirements

  • PHP >= 7.0.0
  • Laravel >= 5.5.0
  • Fileinfo PHP Extension

Installation

This package requires PHP 7+ and Laravel 5.5, for old versions please refer to 1.4

First, install laravel 5.5, and make sure that the database connection settings are correct.

composer.json 更換 "minimum-stability": "stable" => "minimum-stability": "dev"
composer require xn/laravel-admin

Then run these commands to publish assets and config:

php artisan vendor:publish --provider="Xn\Admin\AdminServiceProvider"

php artisan vendor:publish --tag=laravel-admin-checkboxtree

After run command you can find config file in config/admin.php, in this file you can change the install directory,db connection or table names.

At last run following command to finish install.

php artisan admin:install

Open http://localhost/admin/ in browser,use username admin and password admin to login.

Configurations

The file config/admin.php contains an array of configurations, you can find the default configurations in there.

Auth Method

Language Translate

https://github.com/spatie/laravel-translation-loader

Session Configuration

app/config/session.php

  • change table from 'sessions' to 'admin_sessions'
    # 重整按鈕定時器
    'refresh_timer' => [
        'roles' => [
            'administrator'
        ],
        'timers' => [
            10,
            20,
            30,
            60
        ]
    ],

Extensions

ExtensionDescriptionlaravel-admin
helpersSeveral tools to help you in development~1.5
media-managerProvides a web interface to manage local files~1.5
api-testerHelp you to test the local laravel APIs~1.5
schedulingScheduling task manager for laravel-admin~1.5
redis-managerRedis manager for laravel-admin~1.5
backupAn admin interface for managing backups~1.5
log-viewerLog viewer for laravel~1.5
configConfig manager for laravel-admin~1.5
reporterProvides a developer-friendly web interface to view the exception~1.5
wangEditorA rich text editor based on wangeditor~1.6
summernoteA rich text editor based on summernote~1.6
china-distpicker一个基于distpicker的中国省市区选择器~1.6
simplemdeA markdown editor based on simplemde~1.6
phpinfoIntegrate the phpinfo page into laravel-admin~1.6
php-editor <br/> python-editor <br/> js-editor<br/> css-editor<br/> clike-editorSeveral programing language editor extensions based on code-mirror~1.6
star-ratingStar Rating extension for laravel-admin~1.6
json-editorJSON Editor for Laravel-admin~1.6
grid-lightboxTurn your grid into a lightbox & gallery~1.6
daterangepickerIntegrates daterangepicker into laravel-admin~1.6
material-uiMaterial-UI extension for laravel-admin~1.6
sparklineIntegrates jQuery sparkline into laravel-admin~1.6
chartjsUse Chartjs in laravel-admin~1.6
echartsUse Echarts in laravel-admin~1.6
simditorIntegrates simditor full-rich editor into laravel-admin~1.6
cropperA simple jQuery image cropping plugin.~1.6
composer-viewerA web interface of composer packages in laravel.~1.6
data-tableAdvanced table widget for laravel-admin~1.6
watermarkText watermark for laravel-admin~1.6
google-authenticatorGoogle authenticator~1.6

Contributors

This project exists thanks to all the people who contribute. [Contribute]. contributors.svg?width=890&button=false ## Backers Thank you to all our backers! 🙏 [Become a backer] backers.svg?width=890 ## Sponsors Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor] avatar.svg avatar.svg avatar.svg avatar.svg avatar.svg avatar.svg avatar.svg avatar.svg avatar.svg avatar.svg

Other

laravel-admin based on following plugins or services:

License

laravel-admin is licensed under The MIT License (MIT).

Form使用欄位table時檔案、圖片上傳在修改存檔會消失的解決方式

    public function setItemsAttribute($value)
    {
        $oldValue = $this->attributes['items']??[];
        $updValue = array_replace_recursive($oldValue, $value);
        $newValue = array_intersect_key($updValue, $value);
        $this->attributes['items'] = array_values($newValue);
    }