定制 taksu-tech/laravel-restful 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

taksu-tech/laravel-restful

最新稳定版本:v1.1.9

Composer 安装命令:

composer require taksu-tech/laravel-restful

包简介

Restful extension for Laravel by Taksu Tech

README 文档

README

To use

Create a controller class and extends it from CrudController.

Example:

use CommonModelTrait on the model.

class Admin extends Model
{
    use ModelCommonTrait;
    ...
}
namespace App\Http\Controllers;

use App\Models\Admin;
use Taksu\Restful\Controllers\CrudController;

class AdminController extends CrudController
{
    public function __construct()
    {
        parent::__construct(Admin::class);
    }
}

Add in the routes\api.php

Route::apiResource('admins', AdminController::class);

Finally, query the API

GET localhost:8000/api/admins

To install the console commands, in AppServiceProvider, add the following:

public function boot()
{
    if ($this->app->runningInConsole()) {
        $this->commands([
            Taksu\Console\Commands\MakeCrudController::class,
        ]);
    }
}

统计信息

  • 总下载量: 8.41k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-05