g4t/mock-interface 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

g4t/mock-interface

最新稳定版本:0.0.1

Composer 安装命令:

composer require g4t/mock-interface

包简介

README 文档

README

Packagist Version GitHub

The G4T Mock Interface Laravel Package is a versatile and essential tool for managing mock interfaces within your Laravel applications. This package streamlines the process of creating and managing mock interfaces, making it invaluable for developers engaged in API testing and development.

Installation

You can easily integrate this package into your Laravel project using Composer. To do so, execute the following command:

composer require g4t/mock-interface

Usage

The G4T Mock Interface Laravel Package offers a wide array of features to facilitate the management of mock interfaces in your Laravel application. Here's how you can get started:

Create a new interface:

php artisan interface:create UserInterface

To create an interface with a schema file and CRUD functions:

php artisan interface:create UserInterface --all

Create a schema with a schema file and CRUD functions:

php artisan schema:create UserInterface

You can also use the --model and --interface options with the above commands.

Here's an example of an interface and how it can be utilized:

<?php

namespace App\Mock\Interfaces;
use Illuminate\Http\Request;

interface UserInterface
{
    /**
     * @route api/user
     * @method get
     * @return Post \App\Mock\Schemas\User\UserList[paginate]
     */
    public function index();

    /**
     * @route api/user/{id}
     * @method get
     * @return Post \App\Mock\Schemas\User\ShowUser
     */
    public function show(int $id);
    
    /**
     * @route api/user
     * @method post
     * @return Post \App\Mock\Schemas\User\CreateUser
     */
    public function store(Request $request);

    /**
     * @route api/user/{id}
     * @method put
     * @return Post \App\Mock\Schemas\User\UpdateUser
     */
    public function update(int $id, Request $request);

    /**
     * @route api/user/{id}
     * @method delete
     * @return Post \App\Mock\Schemas\User\DeleteUser
     */
    public function destroy(int $id);
    
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-17