Dcat-plus Admin

repository·master·Indexed 40 days ago

https://github.com/ycookies/dcat-plus-admin

A high-performance backend management system builder based on Dcat Admin and Laravel. It enables the rapid construction of admin panels using built-in components and an API. Requires PHP >= 7.4.0 and Laravel 8.0 ~ 12.*.

Tokens
2K
Snippets
5
Records
13
Agent score
100%

What's inside Dcat-plus Admin

  1. Editor.md Features and Supported Syntax

    master

    Editor.md is a full-featured Markdown editor with the following capabilities:

    • Markdown Standards: Supports Standard Markdown, CommonMark, and GFM (GitHub Flavored Markdown).
    • Extended Syntax: Supports Table of Contents (ToC), Emojis, Task lists, and @Links.
    • Scientific & Diagramming: Supports TeX (LaTeX expressions via KaTeX), Flowcharts, and Sequence Diagrams.
    • Core Editor Features: Real-time preview, image upload (cross-domain), code syntax highlighting, code folding, search/replace, and read-only mode.
    • Extensibility: Supports AMD/CMD module loaders (Require.js & Sea.js) and custom plugins. It also allows for custom HTML tag decoding and filtering for security.
  2. Install Dcat-plus Admin

    master

    Dcat-plus Admin is a backend system building tool based on Dcat Admin. To install it, you must first have a Laravel project set up and your .env file configured with correct database credentials.

    1. Install Laravel

    If you haven't installed Laravel yet, run:

    composer create-project --prefer-dist laravel/laravel 项目名称 10.*

    2. Configure Database

    Update your .env file with your database settings:

    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=dcat-admin
    DB_USERNAME=root
    DB_PASSWORD=

    3. Install Dcat-plus Admin

    Run the following command to require the package:

    composer require dcat-plus/laravel-admin

    Or specify a version:

    composer require dcat-plus/laravel-admin:1.4.3

    4. Publish Resources and Install

    Publish the configuration files:

    php artisan admin:publish

    Then, run the installation command:

    php artisan admin:install

    Note: If you encounter the error Specified key was too long ... 767 bytes, add \[Schema::defaultStringLength(191); to the boot method in app/Providers/AppServiceProvider.php, delete all existing database tables, and run php artisan admin:install again.

    composer require dcat-plus/laravel-admin
    php artisan admin:publish
    php artisan admin:install
  3. Set Directory Permissions and Ownership

    master

    Proper directory permissions are critical for Dcat-plus Admin to function correctly. Navigate to your Laravel project root and apply the following permissions:

    Set Directory Permissions

    chmod -R 775 storage/
    chmod -R 775 bootstrap/cache/
    chmod -R 775 lang/
    chmod -R 755 public/

    Set File Ownership

    Depending on your web server user (e.g., nginx or apache), run:

    For Nginx:

    chown -R nginx:nginx .

    For Apache:

    chown -R apache:apache .
    chmod -R 775 storage/
    chmod -R 775 bootstrap/cache/
    chmod -R 775 lang/
    chmod -R 755 public/
    chown -R nginx:nginx .
  4. Initialize Editor.md in HTML and JavaScript

    master

    To use Editor.md, include the editormd.min.css stylesheet and a container element (like a div). You can optionally place a textarea inside the container to provide initial content; if not provided, Editor.md can auto-append a <textarea> tag.

    Initialize the editor using the editormd() function. You must specify the path option, which points to the directory containing dependent libraries (like codemirror and marked) for autoloading.

    <!-- 1. HTML Setup -->
    <link rel="stylesheet" href="editormd.min.css" />
    <div id="editormd">
        <textarea style="display:none;">### Hello Editor.md !</textarea>
    </div>
    
    <!-- 2. JavaScript Initialization -->
    <script src="jquery.min.js"></script>
    <script src="editormd.min.js"></script>
    <script type="text/javascript">
        $(function() {
            var editor = editormd("editormd", {
                path : "../lib/" // Path to dependent libs like codemirror, marked, etc.
            });
        });
    </script>
  5. Configure Web Server for Dcat-plus Admin

    master

    After installation, you must configure your web server to point to the public directory. If you are using Nginx, you must also include the following pseudo-static (rewrite) configuration to ensure Laravel routes work correctly:

    location / {
    	try_files $uri $uri/ /index.php?$query_string;
    }
  6. WebUploader file structure and variants

    master

    The WebUploader plugin provides several JavaScript builds depending on your required runtime (Flash vs. HTML5) and feature set (e.g., image processing).

    • Standard builds: webuploader.js (full version) or webuploader.min.js (minified).
    • Flash-specific: webuploader.flashonly.js requires Uploader.swf to function.
    • HTML5-specific: webuploader.html5only.js for modern browsers without Flash.
    • No Image Processing: webuploader.noimage.js removes image handling logic for both HTML5 and Flash.
    • Mobile/Custom: webuploader.custom.js is a custom build optimized for mobile use.
    ├── Uploader.swf                      # SWF文件,当使用Flash运行时需要引入。
    ├
    ├── webuploader.js                    # 完全版本。
    ├── webuploader.min.js                # min版本
    ├── webuploader.flashonly.js          # 只有Flash实现的版本。
    ├── webuploader.flashonly.min.js       # min版本
    ├── webuploader.html5only.js           # 只有Html5实现的版本。
    ├── webuploader.html5only.min.js       # min版本
    ├── webuploader.noimage.js            # 去除图片处理的版本,包括HTML5和FLASH.
    ├── webuploader.noimage.min.js        # min版本
    ├── webuploader.custom.js             # 自定义打包方案,请查看 Gruntfile.js,满足移动端使用。
    └── webuploader.custom.min.js          # min版本