22. <?php
namespace AppHttpResponderApi;
use AppHttpResponderHateoasResponder;
use IlluminateContractsSupportResponsable;
use AppDomainCollectionGameSoftwareCollection;
class GetThisWeeksGameSoftwareReleaseResponder implements Responsable
{
use HateoasResponder;
private $resource;
public function __construct(GameSoftwareCollection $collection)
{
$this->resource = $collection;
}
public function toResponse($request): IlluminateHttpResponse
{
return $this->hal($this->resource);
}
}
30. Laravelでアノテ`ションを旋喘できるようにする
<?php
namespace AppProviders;
use DoctrineCommonAnnotationsAnnotationReader;
use DoctrineCommonAnnotationsAnnotationRegistry;
use IlluminateSupportServiceProvider;
class AnnotationRegisterServiceProvider extends ServiceProvider
{
public function register()
{
$loader = require base_path().'/vendor/autoload.php';
AnnotationRegistry::registerLoader([$loader, 'loadClass']);
}
}
AppProvidersAnnotationRegisterServiceProvider::class,
36. <?php
namespace AppHttpResponderApi;
use AppHttpResponderHateoasResponder;
use IlluminateContractsSupportResponsable;
use AppDomainCollectionGameSoftwareCollection;
class GetThisWeeksGameSoftwareReleaseResponder implements Responsable
{
use HateoasResponder;
private $resource;
public function __construct(GameSoftwareCollection $collection)
{
$this->resource = $collection;
}
public function toResponse($request): IlluminateHttpResponse
{
return $this->hal($this->resource);
}
}
42. Swaggerとは
https://swagger.io
THE WORLD'S MOST POPULAR API TOOLING
RESTful APIのドキュメントや、サ`バ、クライアントコ`ド、エディ
タ、またそれらをQうための碧などを戻工するフレ`ムワ`ク
Swagger Speci cationをSwagger UIにiみzませることで協xを伏
撹する