PHP code example of g4t / mock-interface
1. Go to this page and download the library: Download g4t/mock-interface 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/ */
g4t / mock-interface example snippets
bash
php artisan interface:create UserInterface
bash
php artisan schema:create UserInterface
bash
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);
}