コード例 #1
0
 /**
  * Shows an endpoint's details
  *
  * @return Response
  */
 public function getEndpoint($alias)
 {
     $endpoint = Endpoint::findByAlias($alias)->first();
     if ($endpoint === null) {
         throw new NotFoundHttpException();
     }
     $baseURL = Setting::byKey('base_api_url');
     $requestParameterTypes = RequestParameterType::all();
     $requestParameters = [];
     foreach ($requestParameterTypes as $requestParameterType) {
         $rp = $endpoint->requestParameters()->where('request_parameter_type_id', '=', $requestParameterType->id)->get();
         $requestParameters[$requestParameterType->id] = ['type' => $requestParameterType, 'parameters' => $rp];
     }
     $data = ['endpoint' => $endpoint, 'requestParameters' => $requestParameters, 'baseURL' => $baseURL];
     return view('layouts.frontend.endpoint', $data);
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $resources = Setting::all();
     return $this->response->withCollection($resources, new SettingTransformer());
 }