phpvms/app/Http/Controllers/AppBaseController.php

31 lines
651 B
PHP
Raw Normal View History

2017-06-09 02:28:26 +08:00
<?php
namespace App\Http\Controllers;
use InfyOm\Generator\Utils\ResponseUtil;
use Response;
/**
* @SWG\Swagger(
* basePath="/api/v1",
* @SWG\Info(
* title="Laravel Generator APIs",
* version="1.0.0",
* )
* )
* This class should be parent class for other API controllers
* Class AppBaseController
*/
class AppBaseController extends Controller
{
public function sendResponse($result, $message)
{
return Response::json(ResponseUtil::makeResponse($message, $result));
}
public function sendError($error, $code = 404)
{
return Response::json(ResponseUtil::makeError($error), $code);
}
}