{"id":3288,"date":"2020-05-29T12:40:45","date_gmt":"2020-05-29T05:40:45","guid":{"rendered":"http:\/\/vietnam.briswell.com\/?p=3288"},"modified":"2020-10-08T16:39:09","modified_gmt":"2020-10-08T09:39:09","slug":"gcp-webservice-laravel-1","status":"publish","type":"post","link":"https:\/\/www.briswell-vn.com\/ja\/news\/gcp-webservice-laravel-1\/","title":{"rendered":"GCP\u3092\u4f7f\u3063\u305fLARAVEL\u958b\u767a  &#8211; Part 1"},"content":{"rendered":"<p><\/p>\n<h2>I.\u00a0<span class=\"s2\">GCP\u3068\u306f<\/span><\/h2>\n<p>GCP\u3068\u306fGoogle Cloud Platform\uff08\u30b0\u30fc\u30b0\u30eb\u30fb\u30af\u30e9\u30a6\u30c9\u30fb\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\uff09\u306e\u7565\u79f0\u3092\u3044\u3044\u3001Google\u304c\u63d0\u4f9b\u3059\u308b\u3001Google\u691c\u7d22\u3084YouTube\u306a\u3069\u306e\u30a8\u30f3\u30c9\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u306e\u30b5\u30fc\u30d3\u30b9\u306bGoogle\u793e\u5185\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u3082\u306e\u3068\u540c\u3058\u30a4\u30f3\u30d5\u30e9\u3092\u4f7f\u7528\u3057\u305f\u30af\u30e9\u30a6\u30c9\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9\u7fa4\u3067\u3059\u3002\u305d\u308c\u3089\u306b\u52a0\u3048\u3066\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u3001\u30b9\u30c8\u30ec\u30fc\u30b8\u3001\u30c7\u30fc\u30bf\u89e3\u6790\u3001\u30de\u30b7\u30f3\u30e9\u30fc\u30cb\u30f3\u30b0\u3068\u3044\u3063\u305f\u30e2\u30b8\u30e5\u30e9\u30fc\u30fb\u30af\u30e9\u30a6\u30c9\u30fb\u30b5\u30fc\u30d3\u30b9\u3092\u3082\u63d0\u4f9b\u3057\u307e\u3059\u3002\u7533\u3057\u8fbc\u307f\u306e\u305f\u3081\u3001\u30af\u30ec\u30b8\u30c3\u30c8\u30ab\u30fc\u30c9\u307e\u305f\u306f\u9280\u884c\u53e3\u5ea7\u3092\u6c42\u3081\u3089\u308c\u307e\u3059\u3002<br \/>\nGCP\u306f\u3001\u30b5\u30fc\u30d3\u30b9\u3068\u3057\u3066\u30a4\u30f3\u30d5\u30e9\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3001\u30b5\u30fc\u30d0\u30fc\u30ec\u30b9\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u74b0\u5883\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<h2>II. Laravel\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/h2>\n<p>Laravel \u306f\u3001Taylor Otwell\u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u305f\u3001Symfony\u3092\u30d9\u30fc\u30b9\u306b\u3057\u305f\u30e2\u30c7\u30eb\u30fb\u30d3\u30e5\u30fc\u30fb\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\uff08MVC\uff09\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u7528\u306e\u7121\u6599\u30fb\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306ePHP\u3067\u66f8\u304b\u308c\u305fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002Laravel\u306e\u3044\u304f\u3064\u304b\u306e\u6a5f\u80fd\u3068\u3057\u3066\u306f\u3001\u5c02\u7528\u7ba1\u7406\u30c4\u30fc\u30eb\u306b\u4f9d\u5b58\u3059\u308b\u30e2\u30b8\u30e5\u30e9\u30fc\u30fb\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u3042\u308a\u307e\u3059\u3002\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u30a2\u30af\u30bb\u30b9\u65b9\u6cd5\u304c\u8272\u3005\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u958b\u767a\u30fb\u4fdd\u5b88\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3082\u3001\u30b7\u30f3\u30bf\u30c3\u30af\u30b9\u30b7\u30e5\u30ac\u30fc\u3068\u3044\u3046\u7cd6\u8863\u69cb\u6587\u306e\u88dc\u52a9\u6a5f\u80fd\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\nLaravel\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306fGitHub\u306b\u30db\u30b9\u30c6\u30a3\u30f3\u30b0\u3055\u308c\u3001MIT\u30e9\u30a4\u30bb\u30f3\u30b9\u306e\u4e0b\u3067\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>III. GCP\u3067\u306eLaravel\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>GAE\uff08Google App Engine\uff09\u3067Laravel\u3092\u5b9f\u884c\u3059\u308b\u524d\u3001\u65b0\u305f\u306bGCP\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066GCP\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/console.cloud.google.com\/\">https:\/\/console.cloud.google.com\/<\/a><\/p>\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff11:<\/strong> A<span class=\"s1\">GCP\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u5f8c\u3001<a href=\"https:\/\/console.cloud.google.com\/project\">Google Cloud Platform Console<\/a>\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<strong>\u300cCREATE PROJECT\u300d\u00a0<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3302\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/Screen-Shot-0032-03-17-at-15.44.33.png\" alt=\"\" width=\"1423\" height=\"201\" \/><\/p>\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff12\uff1a<\/strong>\u65b0\u305f\u306bGCP\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3295\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/Screen-Shot-0032-03-17-at-15.02.00.png\" alt=\"\" width=\"1416\" height=\"490\" \/><\/p>\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff13\uff1a<\/strong>\u65b0\u305f\u306b\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3067\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3296\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/Screen-Shot-0032-03-17-at-15.07.03.png\" alt=\"\" width=\"1414\" height=\"660\" \/><\/p>\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff14\uff1a<\/strong>Laravel\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u65b0\u305f\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u3066\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\n\u30fbcomposer\u3067\u65b0\u305f\u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08gcp-web\u30b5\u30fc\u30d3\u30b9\uff09\u3092\u4f5c\u6210\u3059\u308b\uff1a\u00a0<code class=\"language-php\">composer create<span class=\"token operator\">-<\/span>project <span class=\"token operator\">--<\/span>prefer<span class=\"token operator\">-<\/span>dist laravel<span class=\"token operator\">\/<\/span>laravel gcp-webservices<\/code><br \/>\n\u30fbLaravel\u30bd\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u306e\u79fb\u52d5\u00a0<code class=\"language-php\">cd gcp-webservices<\/code><br \/>\n\u30fblocalhost\u8d77\u52d5\uff1a\u00a0<code class=\"language-php\">php artisan serve<\/code><br \/>\n\u30d6\u30e9\u30a6\u30b6\u3067\u3001 <a href=\"http:\/\/localhost:8000\/\">http:\/\/localhost:8000\/<\/a>\u3000\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\ncomposer create-project &#8211;prefer-dist laravel\/laravel gcp-webservices<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3300\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/Screen-Shot-0032-03-17-at-15.20.17.png\" alt=\"\" width=\"751\" height=\"356\" \/><\/p>\n<p><strong>\u30b9\u30c6\u30c3\u30d7\uff15\uff1a<\/strong><a href=\"https:\/\/dl.google.com\/dl\/cloudsdk\/channels\/rapid\/downloads\/google-cloud-sdk-283.0.0-darwin-x86_64.tar.gz\">Google Cloud SDK<\/a>\u00a0(for MAC OS 64bit)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u521d\u671f\u5316\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u3044\u3066\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\n\u30fb\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3078\u306e\u79fb\u52d5\uff1a\u00a0<code class=\"language-php\">cd\u00a0google-cloud-sdk<\/code><br \/>\n\u30fbGoogle Cloud SDK\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff1a<code class=\"language-php\">.\/install.sh<\/code><br \/>\n\u30fbGCP\u3078\u306e\u30ed\u30b0\u30a4\u30f3\uff1a\u00a0<code class=\"language-php\">gcloud auth login<\/code><br \/>\n<code class=\"language-php\">gcloud<\/code>\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304c\u898b\u4ed8\u304b\u3089\u306a\u3044\u5834\u5408\u3001\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<code class=\"language-php\">source \"\/google-cloud-sdk\/completion.bash.inc\"<\/code><br \/>\n<code class=\"language-php\">source \"\/google-cloud-sdk\/\/path.bash.inc\"<\/code><br \/>\n\u30fbGCP\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u4e00\u89a7\u3092\u8868\u793a\uff1a\u00a0<code class=\"language-php\">gcloud projects list<\/code><br \/>\n\u30fbgcp-webservice\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u63a5\u7d9a\uff1a<code class=\"language-php\">gcloud\u00a0config set project gcp-webservices<\/code><br \/>\n\u30fb\u30c7\u30d7\u30ed\u30a4<br \/>\n1\uff0e\u4ee5\u4e0b\u306e\u3088\u3046\u306bapp.yaml\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n<code><span class=\"pln\">runtime<\/span><span class=\"pun\">:<\/span><span class=\"pln\"> php72<br \/>\nenv_variables<\/span><span class=\"pun\">:<\/span><span class=\"pln\"><br \/>\n<\/span><span class=\"com\">## Put production environment variables here.<\/span><span class=\"pln\"><br \/>\nAPP_KEY<\/span><span class=\"pun\">:<\/span><span class=\"pln\"> YOUR_APP_KEY<br \/>\nAPP_STORAGE<\/span><span class=\"pun\">:<\/span> <span class=\"str\">\/tmp<br \/>\nVIEW_COMPILED_PATH: \/<\/span><span class=\"pln\">tmp<br \/>\nSESSION_DRIVER<\/span><span class=\"pun\">:<\/span><span class=\"pln\"> cookie<\/span><\/code><br \/>\n2\uff0eLaravel\u30bd\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<br \/>\n<code class=\"language-php\">cd gcp-webservices<\/code><br \/>\n3\uff0eapp.yaml\u306eYOUR_APP_KEY\u3092\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u53d6\u5f97\u3057\u305f\u30ad\u30fc\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<br \/>\n<code><span class=\"pln\">php artisan key<\/span><span class=\"pun\">:<\/span><span class=\"pln\">generate <\/span><span class=\"pun\">--<\/span><span class=\"pln\">show<\/span><\/code><br \/>\n4\uff0e\u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092return\u30b3\u30de\u30f3\u30c9\u306e\u4e0a\u306b\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067<code><span class=\"pln\">bootstrap\/app.php<\/span><\/code>\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306b\u3088\u308a\u3001\u672c\u756a\u74b0\u5883\u3067\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u305f\u3081\u30b9\u30c8\u30ec\u30fc\u30b8\u30d1\u30b9\u3092\/ tmp\u306b\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<br \/>\n<code><span class=\"com\"># [START] Add the following block to `bootstrap\/app.php`<\/span><span class=\"pln\"><br \/>\n<\/span><span class=\"com\">\/*<br \/>\n|--------------------------------------------------------------------------<br \/>\n| Set Storage Path<br \/>\n|--------------------------------------------------------------------------<br \/>\n|<br \/>\n| This script allows you to override the default storage location used by<br \/>\n| the \u00a0application. \u00a0You may set the APP_STORAGE environment variable<br \/>\n| in your .env file, \u00a0if not set the default location will be used<br \/>\n|<br \/>\n*\/<\/span><span class=\"pln\"><br \/>\n$app<\/span><span class=\"pun\">-&gt;<\/span><span class=\"pln\">useStoragePath<\/span><span class=\"pun\">(<\/span><span class=\"pln\">env<\/span><span class=\"pun\">(<\/span><span class=\"str\">'APP_STORAGE'<\/span><span class=\"pun\">,<\/span><span class=\"pln\"> base_path<\/span><span class=\"pun\">()<\/span> <span class=\"pun\">.<\/span> <span class=\"str\">'\/storage'<\/span><span class=\"pun\">));<\/span><span class=\"pln\"><br \/>\n<\/span><span class=\"com\"># [END]<\/span><\/code><br \/>\nLaravel\u30bd\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30bf\u30fc\u306b\u79fb\u52d5\u3057\u307e\u3059\u3002<br \/>\n<code class=\"language-php\">cd gcp-webservices<\/code><br \/>\n6\uff0e<code>beyondcode\/laravel-dump-server<\/code>\u3092\u5b9f\u884c\u3057\u3066Composer\u4f9d\u5b58\u95a2\u4fc2\u3092\u524a\u9664\u3057\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3001Laravel\u306e\u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u3088\u3063\u3066<code>bootstrap\/cache\/services.php<\/code>\u3067\u767a\u751f\u3055\u308c\u308b\u30a8\u30e9\u30fc\u306e\u5bfe\u5fdc\u3067\u3059\u3002<br \/>\n<code><span class=\"pln\">composer remove <\/span><span class=\"pun\">--<\/span><span class=\"pln\">dev beyondcode<\/span><span class=\"pun\">\/<\/span><span class=\"pln\">laravel<\/span><span class=\"pun\">-<\/span><span class=\"kwd\">dump<\/span><span class=\"pun\">-<\/span><span class=\"pln\">server<\/span><\/code><br \/>\n7\uff0e<strong>Cloud Build API<\/strong>\u3092<a href=\"https:\/\/console.developers.google.com\/apis\/api\/cloudbuild.googleapis.com\/overview?project=gcp-webservices\">\u3053\u3061\u3089<\/a>\u3067\u6709\u52b9\u306b\u3057\u307e\u3059\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3368 aligncenter\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/enable_cloud_build.png\" alt=\"\" width=\"500\" height=\"289\" \/><\/p>\n<p>8\uff0e\u4e0b\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30a2\u30d7\u30ea\u3092\u30c7\u30d7\u30ed\u30a4\u3057\u307e\u3059\u3002<br \/>\n<code class=\"language-php\">gcloud\u00a0app deploy --version develop<\/code>\uff08\u300cdevelop\u300d\u306f\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u6700\u521d\u7248\u3067\u3059\uff09<br \/>\n\u6700\u521d\u306e\u30c7\u30d7\u30ed\u30a4\u6642\u306bcomposer.lock\u30d5\u30a1\u30a4\u30eb\u3092<strong>\u524a\u9664<\/strong>\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u306e\u5f8c\u3001composer.lock \u3092.gcloudignore\u30d5\u30a1\u30a4\u30eb\u306b\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n9\uff0ehttp:\/\/YOUR_PROJECT_ID.appspot.com \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066Laravel\u306eWelcome\u30da\u30fc\u30b8\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\nYOUR_PROJECT_ID\u3092GCP\u30d7\u30ed\u30b8\u30a7\u30af\u30c8ID\u306b\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\uff01<br \/>\n\u4f8b\uff1a<a href=\"https:\/\/gcp-webservices.appspot.com\/\">https:\/\/gcp-webservices.appspot.com\/<\/a><\/p>\n<h2>IV. \u300cGoogle Vision\u300dAPI<\/h2>\n<p><span class=\"s2\"><strong>\u30b9\u30c6\u30c3\u30d71<\/strong>: \u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067<strong>\u300cGoogle Vision\u300dAPI<\/strong> \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n<code class=\"language-php\">composer require wapnen\/google-cloud-vision-php<\/code><br \/>\n<strong>\u30b9\u30c6\u30c3\u30d72<\/strong>: \u4ee5\u4e0b\u306eURL\u306e\u8aac\u660e\u306b\u5f93\u3063\u3066<strong>\u00a0service account key<\/strong>\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<a href=\"https:\/\/cloud.google.com\/vision\/docs\/before-you-begin\">https:\/\/cloud.google.com\/vision\/docs\/before-you-begin<\/a><\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-3357 aligncenter\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/create_service_account_key.png\" alt=\"\" width=\"500\" height=\"528\" \/><\/p>\n<p><strong>Service account<\/strong>\u30ea\u30b9\u30c8\u304b\u3089<strong>New service account<\/strong>\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p><strong>\u300cService account name\u300d<\/strong>\u9805\u76ee\u306b\u540d\u524d\u3092\u5165\u529b\u3057\u307e\u3059\u3002\uff08\u3053\u306e\u4f8b\u3067<strong>test<\/strong>\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u304b\u3089<strong>\u300cCreate\u300d<\/strong>\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068.json\u30d5\u30a1\u30a4\u30eb\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3055\u308c\u307e\u3059\u3002<strong>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53b3\u5bc6\u306b\u4fdd\u7ba1\u30fb\u7ba1\u7406\u3057\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002\u82e5\u3057\u3001\u4ed6\u4eba\u306f\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u624b\u306b\u5165\u308c\u305f\u3089\u3001\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u5f7c\u3089\u306e\u500b\u4eba\u7684\u306a\u30b5\u30fc\u30d3\u30b9\u3092\u5229\u7528\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u306e\u8cbb\u7528\u3092\u8ca0\u62c5\u3059\u308b\u306e\u306f\u3042\u306a\u305f\u3067\u3059\u3002<\/strong><\/p>\n<h2>V. \u300cGoogle Vision\u300dAPI\u5229\u7528\u306b\u3088\u308b\u753b\u50cf\u304b\u3089\u306e\u30c6\u30ad\u30b9\u30c8\u691c\u51fa\u30fb\u62bd\u51fa<\/h2>\n<p>\u95a2\u9023\u8cc7\u6599\u306f<a href=\"https:\/\/cloud.google.com\/vision\/docs\/ocr#vision_text_detection-php\">google-vision-php<\/a>\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u3067\u53c2\u7167\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3044\u304f\u3064\u304b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3363\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/vision_php_1.png\" alt=\"\" width=\"1616\" height=\"600\" \/><\/p>\n<p>key_path\u3092\u4f7f\u3063\u3066.env\u30d5\u30a1\u30a4\u30eb\u3092\u3001<strong>IV<\/strong>\u3067\u751f\u6210\u3057\u305fkey.json\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3078\u30de\u30a6\u30f3\u30c8\u3059\u308b\u305f\u3081\u306e\u74b0\u5883\u5909\u6570\u3068\u3057\u3066\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u4f8b\u306b\u3066key.json\u30d5\u30a1\u30a4\u30eb\u3092<strong>\u300cgoogle-credential\u300d<\/strong>\u30d5\u30a9\u30eb\u30c0\u30fc\u306b\u4fdd\u5b58\u3057\u3001\u305d\u308c\u3092\u6848\u4ef6\u306e\u30eb\u30fc\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u7f6e\u304d\u307e\u3057\u305f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3366\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/key_path.png\" alt=\"\" width=\"500\" height=\"176\" \/><\/p>\n<p>\u305d\u3057\u3066.env\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u3082\u306e\u304c\u5165\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3365\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/env_exam.png\" alt=\"\" width=\"1078\" height=\"56\" \/><\/p>\n<p>\u4ee5\u4e0b\u306e\u4e8c\u3064\u306e\u51e6\u7406\u3092\u884c\u3046\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u30ea\u30af\u30a8\u30b9\u30c8\u304b\u3089\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u305f\u753b\u50cf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3002<\/li>\n<li>\u4e0a\u8a18\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u4f7f\u3046\u3053\u3068\u3067Vision API\u304b\u3089\u8fd4\u5374\u3055\u308c\u305f\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3055\u305b\u308b\u3053\u3068\u3002<\/li>\n<\/ol>\n<p><strong>annotateImage<\/strong>()\u95a2\u6570\u3060\u3051\u3092\u542b\u307e\u308c\u308b\u300cAnnotationController\u300d\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u305d\u306e\u4e2d\u306b\u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304c\u5165\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3363\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/vision_php_1-1.png\" alt=\"\" width=\"1616\" height=\"600\" \/><\/p>\n<p>\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b<strong>\u300cUpload image\u300d<\/strong>\u30dc\u30bf\u30f3\u3001<strong>\u300cConvert\u300d<\/strong>\u30dc\u30bf\u30f3\u304c\u5165\u3063\u3066\u3044\u308b\u7c21\u5358\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3369\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/sample_template.png\" alt=\"\" width=\"600\" height=\"139\" \/><\/p>\n<p>\u4e0a\u8a18\u753b\u50cf\u3092\u9078\u629e\u3057\u3066\u300cConvert\u300d\u30dc\u30bf\u30f3\u3092\u62bc\u4e0b\u3057\u305f\u3089\u300cGoogle Vision\u300d\u304c<strong> \u300cUpload image\u300d\u3084 \u300cChoose File\u300d<\/strong>\u306e\u6587\u5b57\u5217\u3092\u691c\u51fa\u30fb\u62bd\u51fa\u3067\u304d\u308b\u304b\u3069\u3046\u304b\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3370\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/choose_file.png\" alt=\"\" width=\"600\" height=\"382\" \/><\/p>\n<p>\u3067\u306f\u3001\u7d50\u679c\u3092\u78ba\u8a8d\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3371\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/vision_result.png\" alt=\"\" width=\"600\" height=\"203\" \/><\/p>\n<p>\u3059\u3054\u3044\uff01\u6b63\u3057\u3044\u3067\u3059\u306d\u3002\u3067\u306f\u3001\u4eca\u65e5\u672c\u8a9e\u30c6\u30ad\u30b9\u30c8\u753b\u50cf\u3067\u8a66\u3057\u307e\u3057\u3087\u3046\uff01 \u65e5\u672c\u8a9e\u30cb\u30e5\u30fc\u30b9\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u3063\u3066\u8a66\u3057\u307e\u3057\u3087\u3046\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3373\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/japanese_news.png\" alt=\"\" width=\"600\" height=\"353\" \/><\/p>\n<p>\u7d50\u679c\u3001\u3069\u3046\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-3374\" src=\"https:\/\/briswell-vn.com\/wp-content\/uploads\/2020\/05\/japan_result.png\" alt=\"\" width=\"700\" height=\"269\" \/><\/p>\n<p>\u7d20\u6674\u3089\u3057\u3044\u3088\u306d\uff01<\/p>\n<p><a href=\"https:\/\/briswell-vn.com\/jp\/news\/gcp-webservice-laravel-2\/\">Part2\u306b\u7d9a\u304f<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>I.\u00a0GCP\u3068\u306f GCP\u3068\u306fGoogle Cloud Platform\uff08\u30b0\u30fc\u30b0\u30eb\u30fb\u30af\u30e9\u30a6\u30c9\u30fb\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\uff09\u306e\u7565\u79f0\u3092\u3044\u3044\u3001Goo [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":4014,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[4,71,72],"tags":[],"class_list":["post-3288","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","category-it-tec","category-gcp"],"_links":{"self":[{"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/posts\/3288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/comments?post=3288"}],"version-history":[{"count":0,"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/posts\/3288\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/media\/4014"}],"wp:attachment":[{"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/media?parent=3288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/categories?post=3288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.briswell-vn.com\/ja\/wp-json\/wp\/v2\/tags?post=3288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}