1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /*
- * This file is part of the Jiannei/lumen-api-starter.
- *
- * (c) Jiannei <longjian.huang@foxmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
- namespace App\Http\Controllers\Admin\Base;
- use App\Http\Controllers\Controller;
- use Illuminate\Support\Facades\Cache;
- use Jiannei\Response\Laravel\Support\Facades\Response;
- class CommonController extends Controller
- {
- /**
- * 枚举类型
- * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Resources\Json\Resource
- * Author: Mead
- */
- public function enums()
- {
- $data = trans('enums');
- $enums = [];
- foreach ($data as $key => $val) {
- $k = last(str2arr($key, '\\'));
- $enums[$k] = $val;
- }
- return Response::success($enums);
- }
- /**
- * 清空缓存
- * @return mixed
- * Author: Mead
- */
- public function clear()
- {
- Cache::flush();
- return Response::noContent();
- }
- }
|