SchemaController.php 991 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace Modules\Develop\Http\Controllers;
  3. use Catch\Base\CatchController;
  4. use Illuminate\Http\Request;
  5. use Modules\Develop\Models\Schemas;
  6. /**
  7. * SchemaController
  8. */
  9. class SchemaController extends CatchController
  10. {
  11. public function __construct(
  12. protected Schemas $schemas
  13. ) {
  14. }
  15. /**
  16. * @return mixed
  17. */
  18. public function index()
  19. {
  20. return $this->schemas->getList();
  21. }
  22. /**
  23. * store
  24. *
  25. * @param Request $request
  26. * @throws \Exception
  27. * @return bool
  28. */
  29. public function store(Request $request)
  30. {
  31. return $this->schemas->storeBy($request->all());
  32. }
  33. /**
  34. * show
  35. *
  36. * @param $id
  37. * @return mixed
  38. */
  39. public function show($id)
  40. {
  41. return $this->schemas->show($id);
  42. }
  43. /**
  44. * destroy
  45. *
  46. * @param $id
  47. * @return bool|null
  48. */
  49. public function destroy($id)
  50. {
  51. return $this->schemas->deleteBy($id);
  52. }
  53. }