CommonController.php 678 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /*
  3. * This file is part of the Jiannei/lumen-api-starter.
  4. *
  5. * (c) Jiannei <longjian.huang@foxmail.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace App\Http\Controllers\Admin\Base;
  11. use App\Http\Controllers\Controller;
  12. use Jiannei\Response\Laravel\Support\Facades\Response;
  13. class CommonController extends Controller
  14. {
  15. public function enums()
  16. {
  17. $data = trans('enums');
  18. $enums = [];
  19. foreach ($data as $key => $val) {
  20. $k = last(str2arr($key, '\\'));
  21. $enums[$k] = $val;
  22. }
  23. return Response::success($enums);
  24. }
  25. }