PHP code example of pl / laravel-admin-api

1. Go to this page and download the library: Download pl/laravel-admin-api 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/ */

    

pl / laravel-admin-api example snippets


php artisan vendor:publish --provider="Pl\LaravelAdminApi\LaravelAdminApiProvider"

php artisan migrate

composer dump-autoload

php artisan db:seed --class=LaravelAdminApiSeeder

protected $except = [
    'gjgase/*',
];

php artisan make:admin-api Admin/Base/Gift 1 model=App/Models/Admin/Gift

# 会自动创建如下的文件
文件创建成功: app/Http/Controllers/Admin/Base/GiftController.php (控制器)
文件创建成功: app/Http/Requests/Admin/Base/GiftRequest.php (公共参数验证文件)
文件创建成功: app/Repository/Admin/Base/GiftRepository.php (仓库,逻辑操作)

php artisan make:admin-api Admin/Base/Gift 2 model=App/Models/Admin/Gift

# 成功删除
文件删除成功: app/Http/Controllers/Admin/Base/TestController.php
文件删除成功: app/Http/Requests/Admin/Base/TestRequest.php
文件删除成功: app/Repository/Admin/Base/TestRepository.php