{"id":8839,"date":"2020-06-12T10:00:10","date_gmt":"2020-06-12T01:00:10","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=8839"},"modified":"2020-06-11T22:27:13","modified_gmt":"2020-06-11T13:27:13","slug":"laravel-%e3%83%ab%e3%83%bc%e3%83%86%e3%82%a3%e3%83%b3%e3%82%b0%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/8839","title":{"rendered":"[Laravel] \u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u306f\u300c\u30d6\u30e9\u30a6\u30b6\u3067\u5165\u529b\u3055\u308c\u305fURL\u300d(\u30ea\u30af\u30a8\u30b9\u30c8URL)\u3068\u3001Laravel\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u7d10\u4ed8\u3051\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u4eca\u56de\u306fLaravel\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u3064\u3044\u3066\u306e\u8aac\u660e\u3092\u304a\u3053\u306a\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h4>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30d1\u30e9\u30e1\u30fc\u30bf<\/h4>\n\n\n\n<p><\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u300chttp:\/\/myhomepage.com\/book\/123\u300d\u306e\u3088\u3046\u306bURL\u5185\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u542b\u307e\u305b\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u4e0a\u8a18\u306e\u4f8b\u3067\u306fBookID\u300c123\u300d\u306e\u66f8\u7c4d\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306eURL\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u3059\u3002<\/p>\n\n\n\n<p>Laravel\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Route::get('book\/{id}','BookController@param')<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u5f15\u6570\u5185\u306e\u300c{}\u300d\u90e8\u5206\u304c\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u30fc\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u300c{}\u300d\u90e8\u5206\u306b\u306f\u300c123\u300d\u306e\u3088\u3046\u306b\u81ea\u7531\u306a\u5024\u3092\u57cb\u3081\u8fbc\u3081\u308b\u3088\u3046\u306b\u6307\u5b9a\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u4eee\u306b\u300cid\u300d\u3068\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u304c\u30d1\u30e9\u30e1\u30fc\u30bf\u540d\u306f\u4efb\u610f\u3067\u8a2d\u5b9a\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>BookController\u306e\u4e2d\u306bparam\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u5f15\u6570\u306b\u300c$id\u300d\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001URL\u30d1\u30e9\u30e1\u30fc\u30bf\u3067\u8a2d\u5b9a\u3055\u308c\u305f\u5024\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function param(int $id){\n\treturn '\u5165\u529b\u3055\u308c\u305fID\u306f'.$id.'\u3067\u3059';\n}<\/code><\/pre>\n\n\n\n<p>\u307e\u305f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a\u3059\u308b\u969b\u306b\u306f\u3001\u6b63\u898f\u8868\u73fe\u3067\u5024\u306e\u578b\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Route::get('book\/{id}','BookController@param')\n->where(['id'=>'[0-9]{3}']);<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u4f8b\u3067\u306fid\u30d1\u30e9\u30e1\u30fc\u30bf\u304c3\u6841\u306e\u6570\u5024\u3067\u3042\u308b\u3053\u3068\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<br><br><\/p>\n\n\n\n<p>\u91d1\u66dc\u65e5\u62c5\u5f53: nishida<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8839\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/8839\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"[Laravel] \u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u3064\u3044\u3066\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8839\" data-text=\"[Laravel] \u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306b\u3064\u3044\u3066\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8839\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8839\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u306f\u300c\u30d6\u30e9\u30a6\u30b6\u3067\u5165\u529b\u3055\u308c\u305fURL\u300d(\u30ea\u30af\u30a8\u30b9\u30c8URL)\u3068\u3001Laravel\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u7d10\u4ed8\u3051\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8839"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=8839"}],"version-history":[{"count":4,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8839\/revisions"}],"predecessor-version":[{"id":8846,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8839\/revisions\/8846"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=8839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=8839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=8839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}