{"id":2905,"date":"2018-12-18T02:26:09","date_gmt":"2018-12-17T17:26:09","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=2905"},"modified":"2018-12-19T02:47:32","modified_gmt":"2018-12-18T17:47:32","slug":"laravel-%e3%81%a7%e3%83%aa%e3%82%bd%e3%83%bc%e3%82%b9%e3%82%92%e3%83%95%e3%83%ac%e3%82%ad%e3%82%b7%e3%83%96%e3%83%ab%e3%81%ab%e7%94%9f%e6%88%90%e3%81%99%e3%82%8b%e3%83%91%e3%83%83%e3%82%b1%e3%83%bc","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=2905","title":{"rendered":"Laravel \u3067\u30ea\u30bd\u30fc\u30b9\u3092\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u306b\u751f\u6210\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u300cFlexibleResource\u300d\u3092\u516c\u958b\u3057\u307e\u3057\u305f\uff01"},"content":{"rendered":"\n<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u3082\u3088\u304f\u7d39\u4ecb\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001<code>Laravel<\/code>\u304c\u591a\u6a5f\u80fd\u3067\u9ad8\u6a5f\u80fd\u306a\u306e\u306f\u591a\u304f\u306e\u958b\u767a\u8005\u304c\u8a8d\u3081\u308b\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3001\u5168\u3066\u3092\u5168\u81ea\u52d5\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u304b\u3068\u8a00\u3048\u3070\u3001\u3082\u3061\u308d\u3093\u305d\u3093\u306a\u8a33\u306f\u306a\u304f\u3001\u3084\u306f\u308a\u305d\u3053\u306f\u81ea\u524d\u3067\u958b\u767a\u3059\u308b\u5fc5\u8981\u304c\u3067\u3066\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3068\u306f\u3044\u3063\u3066\u3082\u305d\u3053\u306f\u4eba\u6c17\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e<code>Laravel<\/code>\u3002<br>\u3082\u3057\u4f55\u304b\u6b32\u3057\u3044\u6a5f\u80fd\u304c\u3042\u3063\u305f\u3089\u72ec\u81ea\u306b\u6539\u9020\u3057\u3084\u3059\u304f\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\u3002\u4f8b\u3048\u3070\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3082\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u5185\u3067\u3059\u3050\u65b0\u3057\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3057\u3001\u30e2\u30c7\u30eb\u306e<code>accessor<\/code>\u306a\u3093\u304b\u3082\u3068\u3066\u3082\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u52a0\u5de5\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u958b\u767a\u306e\u4e2d\u3067\u3072\u3068\u3064\u8ab2\u984c\u306b\u306a\u3063\u305f\u306e\u304c<code>Resource API<\/code>\u3067\u3059\u3002<br><code>Laravel<\/code>\u306b\u306f\u3053\u306e\u60c5\u5831\u3092\u751f\u6210\u3059\u308b\u6a5f\u80fd\u306f\u3064\u3044\u3066\u3044\u307e\u3059\u304c\u3001\u901a\u5e38Ajax\u3092\u901a\u3057\u3066\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f\u7528\u610f\u3057\u305fURL\u306b\uff11\u3064\u305a\u3064\u30a2\u30af\u30bb\u30b9\u3057\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093\u3002\u4f8b\u3048\u3070\u3001\uff15\u3064\u306e\u30c7\u30fc\u30bf\u304c\u5fc5\u8981\u306a\u3089\uff15\u30a2\u30af\u30bb\u30b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u3067\u306f\u3001\u3042\u307e\u308a\u8ca0\u8377\u7684\u306b\u3082\u30ec\u30b9\u30dd\u30f3\u30b9\u7684\u306b\u3082\u3088\u304f\u306f\u306a\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u305d\u3053\u3067\u3001\uff11\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3060\u3051\u3067\u3059\u3067\u306b\u6e96\u5099\u3057\u3066\u304a\u3044\u305f\u30ea\u30bd\u30fc\u30b9\u3092\u53ef\u5909\u7684\u306b\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u72ec\u81ea\u30d1\u30c3\u30b1\u30fc\u30b8\u300c<a rel=\"noreferrer noopener\" aria-label=\"\u305d\u3053\u3067\u3001\uff11\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3060\u3051\u3067\u3059\u3067\u306b\u6e96\u5099\u3057\u3066\u304a\u3044\u305f\u30ea\u30bd\u30fc\u30b9\u3092\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u306b\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308bResource API\u306e\u7ba1\u7406\u30d1\u30c3\u30b1\u30fc\u30b8\u300cFlexibleResource\u300d\u3092\u4f5c\u6210\u3057\u3001\u516c\u958b\u3057\u307e\u3057\u305f\u3002 (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\" href=\"https:\/\/github.com\/SUKOHI\/FlexibleResource\" target=\"_blank\">FlexibleResource<\/a>\u300d\u3092\u4f5c\u6210\u3057\u3001\u516c\u958b\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u305d\u306e\u4f7f\u3044\u65b9\u3092\u7d39\u4ecb\u3057\u307e\u3059\uff01<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"275\" height=\"350\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2.png\" alt=\"\" class=\"wp-image-2597\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2.png 275w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/15-2-236x300.png 236w\" sizes=\"auto, (max-width: 275px) 100vw, 275px\" \/><\/figure><\/div>\n\n\n\n<p>\u203b \u958b\u767a\u74b0\u5883\uff1a Laravel 5.7<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">FlexibleResource\u304c\u3067\u304d\u308b\u3053\u3068<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u6c17\u306b\u30ea\u30bd\u30fc\u30b9\u60c5\u5831\u3092\u53d6\u5f97\u3067\u304d\u308b<\/h2>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306b<code>keys<\/code>\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3064\u3051\u308b\u3053\u3068\u3067\u4e00\u6c17\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">https:\/\/example.com\/resource<strong>?keys=userTypes|userNames<\/strong><br><\/pre>\n\n\n\n<p>\u53d6\u5f97\u30c7\u30fc\u30bf\u306f\u3053\u306e\u3088\u3046\u306bJSON\u3067\u30ad\u30fc\u3054\u3068\u306b\u7528\u610f\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>    \"<strong>userTypes<\/strong>\":{\"1\":\"admin\",\"2\":\"owner\",\"3\":\"user\"},<br>    \"<strong>userNames<\/strong>\":{\"1\":\"name1\",\"2\":\"name2\",\"3\":\"name3\"}<br>}<br><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u5404\u30c7\u30fc\u30bf\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u8ffd\u52a0\u3067\u304d\u308b<\/h2>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306b\u500b\u5225\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\uff08\u4f7f\u3044\u65b9\u306f\u3042\u3068\u3067\u8a73\u3057\u304f\u7d39\u4ecb\u3057\u307e\u3059\uff09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">https:\/\/example.com\/resource?keys=<strong>userTypes:value_1,value_2,value_3<\/strong><br><\/pre>\n\n\n\n<p>\u203b \u3061\u306a\u307f\u306b\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u4ed8\u3051\u65b9\u306f<code>Laravel<\/code>\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30eb\u30fc\u30eb\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u81ea\u52d5\u3067\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\uff08\u914d\u5217\uff09\u5316\u3067\u304d\u308b<\/h2>\n\n\n\n<p>JavaScript\u3067\u306f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u9806\u756a\u304c\u4fdd\u8a3c\u3055\u308c\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u3057\u3070\u3057\u3070\u914d\u5217\u306b\u5909\u63db\u3057\u3066\u30c7\u30fc\u30bf\u306e\u9001\u53d7\u4fe1\u3092\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u81ea\u52d5\u7684\u306b\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001<code>userTypes<\/code>\u304b\u3089\u30c7\u30fc\u30bf\u53d6\u5f97\u304c\u3067\u304d\u308b\u5834\u5408\u3001<code>userTypeCollection<\/code>\u3068\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b<code>key<\/code>\u3068<code>value<\/code>\u306e\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u306a\u3063\u3066\u8fd4\u3063\u3066\u304d\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u308f\u3056\u308f\u3056userTypeCollection()\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\uff09<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>    \"<strong>userTypeCollection<\/strong>\":[<br>        {\"<strong>key<\/strong>\":1, \"<strong>value<\/strong>\":\"admin\"},<br>        {\"<strong>key<\/strong>\":2, \"<strong>value<\/strong>\":\"owner\"},<br>        {\"<strong>key<\/strong>\":3, \"<strong>value<\/strong>\":\"user\"}<br>    ]<br>}<\/pre>\n\n\n\n<p>\u307e\u305f\u3001<code>key<\/code>\u3068<code>value<\/code>\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\u305d\u306e\u5834\u5408\u306f<code>$auto_collections<\/code>\u3078\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">class ResourceController extends Controller<br>{<br>    use FlexibleResourceTrait;<br><br>    <strong>protected $auto_collections = [<br>        'userTypes' =&gt; ['id' =&gt; 'type']<br>    ];<\/strong><\/pre>\n\n\n\n<p>\u3059\u308b\u3068\u3001\u30c7\u30fc\u30bf\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">{<br>    \"<strong>userTypeCollection<\/strong>\":[<br>        {\"<strong>id<\/strong>\":1, \"<strong>type<\/strong>\":\"admin\"},<br>        {\"<strong>id<\/strong>\":2, \"<strong>type<\/strong>\":\"owner\"},<br>        {\"<strong>id<\/strong>\":3, \"<strong>type<\/strong>\":\"user\"}<br>    ]<br>}<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h1>\n\n\n\n<p>\u4ed6\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u540c\u3058\u304f<code>composer<\/code>\u3067\u4e00\u6c17\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>composer require sukohi\/flexible-resource:1.*<\/strong><\/pre>\n\n\n\n<p>\u203b Laravel 5.7\u3067\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u3057\u3066\u307e\u3059\u304c<code>Trait<\/code>\u3092\u4f7f\u3063\u3066\u3044\u308b\u3060\u3051\u306a\u306e\u3067\u3001\u304a\u305d\u3089\u304f\u904e\u53bb\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u3082\u52d5\u304f\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u6e96\u5099<\/h1>\n\n\n\n<p>\u6b21\u306e\u3088\u3046\u306b<code>FlexibleResourceTrait<\/code>\u3092\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304b\u3089\u547c\u3073\u51fa\u3059\u3060\u3051\u3067OK\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">class ResourceController extends Controller<br>{<br>    <strong>use FlexibleResourceTrait;<\/strong><\/pre>\n\n\n\n<p>\u306a\u304a\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Route::<em>get<\/em>('resource', <strong>'ResourceController@get'<\/strong>);<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">\u500b\u5225\u30c7\u30fc\u30bf\u306e\u8a2d\u5b9a<\/h1>\n\n\n\n<p>\u30c8\u30ec\u30a4\u30c8\u3068\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u6e96\u5099\u3057\u305f\u3089\u3001\u5404\u500b\u5225\u30c7\u30fc\u30bf\u306e\u8a2d\u5b9a\u3067\u3059\u3002<br>\u30c7\u30fc\u30bf\u306e\u8a2d\u5b9a\u306f<code>private<\/code>\u30e1\u30bd\u30c3\u30c9\u3067\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001\u5148\u307b\u3069\u306e<code>userTypes<\/code>\u306e\u4f8b\u3067\u8a00\u3046\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">class ResourceController extends Controller<br>{<br>    <font color=\"#191e23\"><span style=\"background-color: rgb(232, 234, 235);\"><b>\/\/&nbsp;\u7701\u7565<\/b><\/span><\/font><br><br>    <strong>private function userTypes() {<\/strong><br><br>        return [<br>            1 =&gt; 'admin',<br>            2 =&gt; 'owner',<br>            3 =&gt; 'user'<br>        ];<br><br>    <strong>}<\/strong><\/pre>\n\n\n\n<p>\u203b \u306a\u304a\u3001\u8fd4\u3059\u5024\u306f<code>Laravel<\/code>\u306e<code>Collection<\/code>\u3067\u3082\u554f\u984c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u305d\u3057\u3066\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4ed8\u3051\u305f\u5834\u5408\u306f\u901a\u5e38\u901a\u308a\u5f15\u6570\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u30c7\u30fc\u30bf\u306e\u4e26\u3079\u66ff\u3048\u3084\u7d5e\u308a\u8fbc\u307f\u306b\u4f7f\u3046\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">private function <strong>userTypes($direction = 'asc')<\/strong> {<br><br>    $user_types = [<br>        1 =&gt; 'admin',<br>        2 =&gt; 'owner',<br>        3 =&gt; 'user'<br>    ];<br><br>    if($direction == 'desc') {<br><br>        return collect($user_types)-&gt;reverse();<br><br>    }<br><br>    return $user_types;<br><br>}<\/pre>\n\n\n\n<h1 class=\"wp-block-heading\">Vue.js\u3068\u9023\u643a\u3057\u3066\u4f7f\u3046<\/h1>\n\n\n\n<p>\u3082\u3057<code>Vue.js<\/code>\u304b\u3089<code>FlexibleResource<\/code>\u3067\u751f\u6210\u3057\u305f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u5c02\u7528Vue\u30df\u30c3\u30af\u30b9\u30a4\u30f3\u300c<a rel=\"noreferrer noopener\" aria-label=\"\u3082\u3057Vue.js\u304b\u3089FlexibleResource\u3067\u751f\u6210\u3057\u305f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u5c02\u7528\u306eVue\u30df\u30c3\u30af\u30b9\u30a4\u30f3\u300c\u300d\u3082\u516c\u958b\u3057\u3066\u3044\u308b\u306e\u3067\u3053\u3061\u3089\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u8981axios\uff09 (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\" href=\"https:\/\/github.com\/SUKOHI\/v-flexible-resource\" target=\"_blank\">v-flexible-resource<\/a>\u300d\u3082\u516c\u958b\u3057\u3066\u3044\u308b\u306e\u3067\u3053\u3061\u3089\u3092\u5229\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u8981axios\uff09<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n\n\n\n<p><code>npm<\/code> \u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong>npm i v-flexible-resource --save<\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<p><code>resourceMixin<\/code>\u3068\u3044\u3046\u5909\u6570\u306b\u30df\u30c3\u30af\u30b9\u30a4\u30f3\u304c\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001<code>resource.js<\/code>\u3092\u8aad\u307f\u8fbc\u3093\u3067\u6b21\u306e\u3088\u3046\u306b\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;<em>script src<\/em>=\"<strong>\/PATH\/TO\/YOUR\/FOLDER\/v-flexible-resource\/resource.js<\/strong>\">&lt;\/<em>script<\/em>><br>&lt;<em>script<\/em>><br><br>new Vue({<br>    el: '#app',<br>        data: {<br>            <strong>userTypes<\/strong>: {},<br>            <strong>userTypeCollection<\/strong>: []<br>        },<br>        mounted() {<br><br>            var <em>keys <\/em>= ['<strong>userTypes<\/strong>', '<strong>userTypeCollection<\/strong>'];<br>            <em>this<\/em>.resource(<em>keys<\/em>, function(data){<br><br>                <em>console<\/em>.<em>log<\/em>(<em>data<\/em>); \/\/ \u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306f\u7701\u7565\u53ef<br><br>            });<br><br>        }<br>    })<br><br>&lt;\/<em>script<\/em>><br><\/pre>\n\n\n\n<p>\u306a\u304a\u3001<code>data<\/code>\u5909\u6570\u3078\u306e\u683c\u7d0d\u306f\u30df\u30c3\u30af\u30b9\u30a4\u30f3\u5185\u3067\u81ea\u52d5\u7684\u306b\u884c\u308f\u308c\u307e\u3059\u306e\u3067\u3001\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u95a2\u6570\u306f\u7701\u7565\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u30ea\u30bd\u30fc\u30b9\u306eURL\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>resourceUrl<\/code>\u3092\u4e0a\u66f8\u304d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">data: {<br>    <strong>resourceUrl: '\/YOUR\/RESOURCE\/URL'<\/strong><br>},<\/pre>\n\n\n\n<p>\u3010\u8ffd\u8a18\uff1a 2018.12.19\u3011\u3000\u30d1\u30c3\u30b1\u30fc\u30b8\u5185\u3067<code>Vue.mixin()<\/code>\u3092\u81ea\u52d5\u7684\u306b\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u306e\u3067\u3001<code>resourceMixin<\/code>\u3068\u3044\u3046\u5909\u6570\u306f\u5fc5\u8981\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u304a\u308f\u308a\u306b<\/h1>\n\n\n\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Resource API<\/code>\u3092\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u306b\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u72ec\u81ea\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3061\u306a\u307f\u306b\u3001\u5f53\u521d\u306f<code>Laravel<\/code>\u5074\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u5185\u306bVue\u306e\u30b3\u30fc\u30c9\u3082\u683c\u7d0d\u3059\u308b\u3064\u3082\u308a\u3067\u3057\u305f\u304c\u3001<code>Laravel Mix<\/code>\u3067\u4f7f\u3046\u306b\u306f<code>npm<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u3059\u308b\u3079\u304d\u3068\u306e\u5224\u65ad\u304b\u3089\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u5206\u5272\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u5f79\u306b\u305f\u3066\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"170\" height=\"320\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png\" alt=\"\" class=\"wp-image-2158\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29.png 170w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/29-159x300.png 159w\" sizes=\"auto, (max-width: 170px) 100vw, 170px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u3082\u3088\u304f\u7d39\u4ecb\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001Laravel\u304c\u591a\u6a5f\u80fd\u3067\u9ad8\u6a5f\u80fd\u306a\u306e\u306f\u591a\u304f\u306e\u958b\u767a\u8005\u304c\u8a8d\u3081\u308b\u3068\u3053\u308d\u3067\u3057\u3087\u3046\u3002 \u305f\u3060\u3001\u5168\u3066\u3092\u5168\u81ea\u52d5\u3067\u3084\u3063\u3066\u304f\u308c\u308b\u304b\u3068 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=2905\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel \u3067\u30ea\u30bd\u30fc\u30b9\u3092\u30d5\u30ec\u30ad\u30b7\u30d6\u30eb\u306b\u751f\u6210\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u300cFlexibleResource\u300d\u3092\u516c\u958b\u3057\u307e\u3057\u305f\uff01&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":3027,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[62],"class_list":["post-2905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-62"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2905"}],"version-history":[{"count":130,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2905\/revisions"}],"predecessor-version":[{"id":3036,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/2905\/revisions\/3036"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/3027"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}