{"id":12909,"date":"2023-04-07T10:00:00","date_gmt":"2023-04-07T01:00:00","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=12909"},"modified":"2023-04-06T19:24:20","modified_gmt":"2023-04-06T10:24:20","slug":"laravel-%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b5%e3%81%a8%e3%83%9f%e3%83%a5%e3%83%bc%e3%83%86%e3%82%bf%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/12909","title":{"rendered":"Laravel : \u30a2\u30af\u30bb\u30b5\u3068\u30df\u30e5\u30fc\u30c6\u30bf\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<p>Laravel\u3067\u306f\u3001\u30a2\u30af\u30bb\u30b5\u30fc\u3068\u30df\u30e5\u30fc\u30c6\u30fc\u30bf\u30fc\u306f\u3001\u30e2\u30c7\u30eb\u306e\u5c5e\u6027\u3092\u53d6\u5f97\u3057\u305f\u308a\u5024\u3092\u8a2d\u5b9a\u3057\u305f\u308a\u3059\u308b\u969b\u306b\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u5c5e\u6027\u3092\u542b\u3093\u3060 &#8220;Article&#8221; \u30e2\u30c7\u30eb\u304c\u3042\u308b\u3068\u3057\u307e\u3059\uff1a &#8220;title&#8221;\u3001&#8221;body&#8221;\u3001&#8221;published_at &#8220;\u3067\u3059\u3002title &#8220;\u5c5e\u6027\u306f\u5e38\u306b\u524d\u5f8c\u306e\u7a7a\u767d\u304c\u53d6\u308a\u9664\u304b\u308c\u3001&#8221;published_at &#8220;\u5c5e\u6027\u306f\u5e38\u306bdatetime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u4fdd\u5b58\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u305f\u3044\u3067\u3059\u3002\u3053\u308c\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001\u5404\u5c5e\u6027\u306b\u5bfe\u3057\u3066\u30a2\u30af\u30bb\u30b5\u30fc\u3068\u30df\u30e5\u30fc\u30c6\u30fc\u30bf\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001&#8221;title &#8220;\u5c5e\u6027\u306e\u30a2\u30af\u30bb\u30b5\u30fc\u30e1\u30bd\u30c3\u30c9\u3068\u30df\u30e5\u30fc\u30c6\u30fc\u30bf\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3059\u308b\u4f8b\u3067\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Article extends Model\n{\n    \/\/ Accessor method for the \"title\" attribute\n    public function getTitleAttribute($value)\n    {\n        return trim($value);\n    }\n\n    \/\/ Mutator method for the \"title\" attribute\n    public function setTitleAttribute($value)\n    {\n        $this-&gt;attributes&#091;'title'] = trim($value);\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u3001&#8221;published_at &#8220;\u5c5e\u6027\u306e\u30a2\u30af\u30bb\u30b5\u30fc\u30e1\u30bd\u30c3\u30c9\u3068\u30df\u30e5\u30fc\u30c6\u30fc\u30bf\u30fc\u30e1\u30bd\u30c3\u30c9\u3092\u4f5c\u6210\u3059\u308b\u4f8b\u3067\u8aac\u660e\u3057\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Article extends Model\n{\n    \/\/ Accessor method for the \"published_at\" attribute\n    public function getPublishedAtAttribute($value)\n    {\n        return Carbon::createFromFormat('Y-m-d H:i:s', $value);\n    }\n\n    \/\/ Mutator method for the \"published_at\" attribute\n    public function setPublishedAtAttribute($value)\n    {\n        $this-&gt;attributes&#091;'published_at'] = Carbon::parse($value)-&gt;format('Y-m-d H:i:s');\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u4f8b\u3067\u306f\u3001\u300cgetPublishedAtAttribute\u300d\u30e1\u30bd\u30c3\u30c9\u3067\u300cpublished_at\u300d\u5c5e\u6027\u3092\u6587\u5b57\u5217\u304b\u3089Carbon datetime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3001\u4f5c\u696d\u3092\u3057\u3084\u3059\u304f\u3057\u307e\u3059\u3002setPublishedAtAttribute\u300d\u30e1\u30bd\u30c3\u30c9\u3082\u3001\u30e2\u30c7\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u524d\u306b\u5024\u3092datetime\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u5909\u63db\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u3088\u3046\u306b\u30a2\u30af\u30bb\u30c3\u30b5\u3068\u30df\u30e5\u30fc\u30c6\u30fc\u30bf\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30e2\u30c7\u30eb\u3092\u4f7f\u3046\u305f\u3073\u306b\u624b\u52d5\u3067\u3053\u308c\u3089\u306e\u64cd\u4f5c\u3092\u884c\u308f\u306a\u304f\u3066\u3082\u3001\u30e2\u30c7\u30eb\u306e\u5c5e\u6027\u304c\u5e38\u306b\u5e0c\u671b\u3059\u308b\u5f62\u5f0f\u3067\u4fdd\u5b58\u30fb\u53d6\u5f97\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u91d1\u66dc\u62c5\u5f53 \u2013 Ami<\/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\/12909\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/12909\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"Laravel : \u30a2\u30af\u30bb\u30b5\u3068\u30df\u30e5\u30fc\u30c6\u30bf\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\/12909\" data-text=\"Laravel : \u30a2\u30af\u30bb\u30b5\u3068\u30df\u30e5\u30fc\u30c6\u30bf\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\/12909\" 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\/12909\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u3067\u306f\u3001\u30a2\u30af\u30bb\u30b5\u30fc\u3068\u30df\u30e5\u30fc\u30c6\u30fc\u30bf\u30fc\u306f\u3001\u30e2\u30c7\u30eb\u306e\u5c5e\u6027\u3092\u53d6\u5f97\u3057\u305f\u308a\u5024\u3092\u8a2d\u5b9a\u3057\u305f\u308a\u3059\u308b\u969b\u306b\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002 \u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u5c5e\u6027\u3092\u542b\u3093\u3060 &#8220;Article&#8221; \u30e2\u30c7\u30eb\u304c\u3042\u308b\u3068\u3057\u307e\u3059\uff1a [&hellip;]<\/p>\n","protected":false},"author":19,"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\/12909"}],"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\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=12909"}],"version-history":[{"count":1,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12909\/revisions"}],"predecessor-version":[{"id":12910,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12909\/revisions\/12910"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=12909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=12909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=12909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}