{"id":5431,"date":"2019-12-23T21:10:20","date_gmt":"2019-12-23T12:10:20","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=5431"},"modified":"2019-12-23T21:10:20","modified_gmt":"2019-12-23T12:10:20","slug":"%e3%81%99%e3%81%90%e3%81%a7%e3%81%8d%e3%82%8b%ef%bc%81laravel%e3%81%a7%e7%94%bb%e5%83%8f%e3%81%ae%e7%9b%b4%e3%83%aa%e3%83%b3%e3%82%af%e3%82%92%e7%a6%81%e6%ad%a2%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=5431","title":{"rendered":"\u3059\u3050\u3067\u304d\u308b\uff01Laravel\u3067\u753b\u50cf\u306e\u76f4\u30ea\u30f3\u30af\u3092\u7981\u6b62\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593 <a href=\"https:\/\/blog.capilano-fw.com\/?p=5204\">\u610f\u5916\u3068\u7c21\u5358\uff01Laravel\u3067gif\u30a2\u30cb\u30e1\u3092\u3064\u304f\u308b<\/a> \u306a\u3069\u3001\u3044\u304f\u3064\u304b\u753b\u50cf\u306b\u95a2\u9023\u3059\u308b\u8a18\u4e8b\u3092\u516c\u958b\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u308c\u3089\u306e\u8a18\u4e8b\u306f\u753b\u50cf\u81ea\u4f53\u3092\u3064\u304f\u3063\u305f\u308a\u6295\u7a3f\u3057\u305f\u308a\u3059\u308b\u3068\u3044\u3046\u5185\u5bb9\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u4eca\u56de\u306f\u5c11\u3057\u9055\u3063\u305f\u89d2\u5ea6\u304b\u3089\u753b\u50cf\u306b\u95a2\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306b\u4f55\u304b\u3068\u3044\u3046\u3068\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u76f4\u30ea\u30f3\u30af\u3092\u7981\u6b62\u3059\u308b\u65b9\u6cd5<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u76f4\u30ea\u30f3\u30af\u3068\u306f\u3001\u4ed6\u4eba\u306e\u30b5\u30a4\u30c8\u306b\u3042\u308b\u753b\u50cf\u3092\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u3067\u8868\u793a\u3059\u308b\u3053\u3068\u3067\u3001\u516c\u958b\u3057\u3066\u3044\u308b\u5074\u304b\u3089\u3059\u308b\u3068\u30b5\u30fc\u30d0\u30fc\u3078\u306e\u8ca0\u8377\u304c\u5897\u3048\u308b\u306a\u3069\u3001\u3042\u307e\u308a\u5b09\u3057\u3044\u3053\u3068\u3067\u306f\u306a\u304b\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\uff01<\/p>\n<p>\u4eca\u56de\u306f<code>Laravel<\/code>\u3092\u4f7f\u3063\u3066\u753b\u50cf\u306e\u76f4\u30ea\u30f3\u30af\u3092\u7981\u6b62\u3059\u308b\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 6.x<\/p>\n<h1>\u3069\u306e\u3088\u3046\u306b\u3057\u3066\u76f4\u30ea\u30f3\u30af\u7981\u6b62\u306e\u753b\u50cf\u3092\u5b9f\u88c5\u3092\u3059\u308b\u304b<\/h1>\n<p>\u76f4\u30ea\u30f3\u30af\u3092\u5b8c\u5168\u306b\u7981\u6b62\u3059\u308b\u306b\u306f\u3001\u307e\u305a<code>.htaccess<\/code>\u306a\u3069\u3067\u30ea\u30d5\u30a1\u30e9\uff08\u547c\u3073\u51fa\u3057\u5143\u306eURL\uff09\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u65b9\u6cd5\u304c\u8003\u3048\u3089\u308c\u307e\u3059\u304c\u3001\u30ea\u30d5\u30a1\u30e9\u306f\u6bd4\u8f03\u7684\u7c21\u5358\u306b\u507d\u88c5\u3067\u304d\u308b\u305f\u3081\u3001\u4eca\u56de\u306f\u5c11\u3057\u8003\u3048\u65b9\u3092\u5909\u3048\u3066\u3001<strong>\u300c\u3054\u304f\u3054\u304f\u77ed\u3044\u6709\u52b9\u671f\u9650\u304c\u3042\u308bURL\u300d<\/strong>\u3092\u3064\u304f\u308b\u3053\u3068\u3067\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u753b\u50cfURL\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b<\/p>\n<ul>\n<li>\u6709\u52b9\u671f\u9650\uff08\u4f8b\u3048\u3070\u3001\uff11\u5206\u9593\u5f8c\u307e\u3067\u6709\u52b9\uff09<\/li>\n<li>\u305d\u306e\u6709\u52b9\u671f\u9650\u304c\u6b63\u3057\u3044\u3082\u306e\u306a\u306e\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9<\/li>\n<\/ul>\n<p>\u3092\u3064\u3051\u308b\u3068\u3044\u3046\u65b9\u6cd5\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong>\uff08URL\u306e\u4f8b\uff09<\/strong><\/p>\n<pre><strong>http:\/\/******\/item_image\/1?expiration=*****&amp;token=******<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u5185\u3067\u306f\u968f\u6642\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306e\u3067\u3044\u3064\u3067\u3082\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u304c\u3001\u76f4\u30ea\u30f3\u30af\u306e\u5834\u5408\u306f\u3059\u3050\u306b\u6709\u52b9\u671f\u9650\u304c\u304d\u308c\u3066\u3057\u307e\u3046\u306e\u3067\u3001\u305d\u308c\u4ee5\u964d\u306f\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\u3053\u3068\u306f\u306a\u304f\u306a\u308b\u3001\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u4f5c\u696d\u3092\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\uff01<\/p>\n<h1>\u5546\u54c1\u753b\u50cf\u3092\u7528\u610f\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3068\u3057\u3066\u3001\u79c1\u304c\u6700\u8fd1\u5927\u30d5\u30a1\u30f3\u306b\u306a\u3063\u305f<strong>\u300c\u516d\u7532\u30d3\u30fc\u30ebIPA\u30fb\u30b9\u30b5\u30ce\u30aa\u300d<\/strong>\u306e\u753b\u50cf\u3092\u4f7f\u3063\u3066\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002\uff08\u500b\u4eba\u7684\u306b\u30c8\u30c3\u30d7\uff13\u306b\u5165\u3063\u3066\u3044\u307e\u3059\ud83c\udf7a\u2728\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5432\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_1.jpg\" alt=\"\" width=\"360\" height=\"480\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_1.jpg 360w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_1-225x300.jpg 225w\" sizes=\"auto, (max-width: 360px) 100vw, 360px\" \/><\/p>\n<p><code>Laravel<\/code>\u306b<code>\/storage\/app\/images\/items<\/code>\u3068\u3044\u3046\u30d5\u30a9\u30eb\u30c0\u3092\u3064\u304f\u308a\u3001\u3053\u306e\u4e2d\u3078\u753b\u50cf\u3092\u8a2d\u7f6e\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5436\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_2.png\" alt=\"\" width=\"491\" height=\"126\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_2.png 491w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_2-300x77.png 300w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<pre><strong>Route::get('item_image\/{id}', 'ImageController@item_image');<\/strong><\/pre>\n<p><code>{id}<\/code>\u306e\u90e8\u5206\u304c\u53ef\u5909\u3067\u3001\u6570\u5b57\u304c\u5165\u3063\u3066\u304d\u307e\u3059\u3002<\/p>\n<h1>\u30e2\u30c7\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u753b\u50cf\u306e<code>URL<\/code>\u3092\u7c21\u5358\u306b\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u30e2\u30c7\u30eb\u3092\u3064\u304f\u3063\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\uff08\u305f\u3060\u3057\u3001\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u306a\u306e\u3067DB\u306f\u4f7f\u3044\u307e\u305b\u3093\u3002\u7686\u3055\u3093\u306e\u72b6\u6cc1\u306b\u5408\u308f\u305b\u3066\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306a\u3069\u3082\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<pre><strong>php artisan make:model Item<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Item extends Model\r\n{\r\n<strong>    public static function url($path) { \/\/ \u76f4\u30ea\u30f3\u30af\u7981\u6b62\u753b\u50cf\u306eURL\u3092\u3064\u304f\u308b<\/strong>\r\n\r\n<strong>        $expiration = now()-&gt;addMinute()-&gt;format('U');   \/\/ 1\u5206\u9593\u3060\u3051\u6709\u52b9<\/strong>\r\n<strong>        $token = encrypt($expiration);<\/strong>\r\n<strong>        return url($path) .<\/strong>\r\n<strong>            '?expiration='. $expiration .<\/strong>\r\n<strong>            '&amp;token='. $token;<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u91cd\u8981\u306a\u306e\u306f\u3001<code>encrypt()<\/code>\u306e\u90e8\u5206\u3067\u3059\u3002\u3053\u3053\u3067\u306f\u3001<code>Laravel<\/code>\u306e\u6697\u53f7\u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u6709\u52b9\u671f\u9650\u3092\u6697\u53f7\u5316\u3057\u3001\u30ef\u30f3\u30bf\u30a4\u30e0\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u3064\u304f\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u5f8c\u307b\u3069\u3053\u308c\u3089\u306e\u30c7\u30fc\u30bf\u3092\u3064\u304b\u3063\u3066\u5fa9\u53f7\u3057\u3001<code>expiration<\/code>\u306e\u4e2d\u8eab\u304c\u6b63\u3057\u3044\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller ImageController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>app\/Http\/Controllers\/ImageController.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass ImageController extends Controller\r\n{\r\n    <strong>public function __construct()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;middleware('protect_image');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function item_image($id) {<\/strong>\r\n\r\n<strong>        $image_path = storage_path('app\/images\/items\/'. $id .'.jpg');<\/strong>\r\n\r\n<strong>        if(!file_exists($image_path)) { \/\/ \u30d5\u30a1\u30a4\u30eb\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u304d<\/strong>\r\n\r\n<strong>            abort(404);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        return response()-&gt;file($image_path);<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u307e\u305a<code>item_image()<\/code>\u3067\u306f\u753b\u50cf\u306e\u5b58\u5728\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u3082\u3057\u3042\u308c\u3070\u753b\u50cf\u30c7\u30fc\u30bf\u3092\u8fd4\u3059\u3068\u3044\u3046\u30b7\u30f3\u30d7\u30eb\u306a\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u91cd\u8981\u306a\u306e\u306f<code>__construct()<\/code>\u5185\u3067\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u90e8\u5206\u3067\u3059\u3002\u3053\u306e\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306f\u6b21\u306e\u9805\u76ee\u3067\u3064\u304f\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u753b\u50cf\u3092\u8868\u793a\u3059\u3079\u304d\u304b\u62d2\u5426\u3059\u3079\u304d\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5148\u307b\u3069\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e<code>__construcct()<\/code>\u5185\u3067\u8a2d\u5b9a\u3057\u305f\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan make:middleware ProtectImage\r\n<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001<code>app\/Http\/Middleware\/ProtectImage.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Middleware;\r\n\r\nuse Carbon\\Carbon;\r\nuse Closure;\r\n\r\nclass ProtectImage\r\n{\r\n    \/**\r\n     * Handle an incoming request.\r\n     *\r\n     * @param  \\Illuminate\\Http\\Request  $request\r\n     * @param  \\Closure  $next\r\n     * @return mixed\r\n     *\/\r\n    <strong>public function handle($request, Closure $next)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $expiration = $request-&gt;expiration;<\/strong>\r\n<strong>        $expiration_dt = Carbon::createFromTimestamp($request-&gt;expiration);<\/strong>\r\n<strong>        $token = $request-&gt;token;<\/strong>\r\n\r\n<strong>        if($expiration_dt-&gt;isFuture() &amp;&amp; decrypt($token) === $expiration) {<\/strong>\r\n\r\n<strong>            return $next($request);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        abort(410, '\u6709\u52b9\u671f\u9650\u5207\u308c\u3067\u3059');<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u304c\u4f5c\u6210\u3067\u304d\u305f\u3089\u3001<code>app\/Http\/Kernel.php<\/code>\u306e<code>$routeMiddleware<\/code>\u306b\u767b\u9332\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http;\r\n\r\n<strong>use App\\Http\\Middleware\\ProtectImage;<\/strong>\r\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\r\n\r\nclass Kernel extends HttpKernel\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    protected $routeMiddleware = [\r\n\r\n        \/\/ \u7701\u7565\r\n\r\n        <strong>'protect_image' =&gt; ProtectImage::class<\/strong>\r\n    ];<\/pre>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u81ea\u4f53\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u3055\u3089\u306b\u305d\u306eURL\u306b\uff11\u5206\u5f8c\u30a2\u30af\u30bb\u30b9\u3057\u3066\u6709\u52b9\u671f\u9650\u5207\u308c\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u30d3\u30e5\u30fc\u3067\u3059\u3002<br \/>\n<code>resources\/views\/item_image.blade.php<\/code>\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;body&gt;\r\n    &lt;div&gt;\r\n        &lt;img src=\"<strong>{{ \\App\\Item::url('item_image\/1') }}<\/strong>\"&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u305d\u3057\u3066\u3001\u305d\u306e\u30d3\u30e5\u30fc\u3092<code>routes\/web.php<\/code>\u306b\u30eb\u30fc\u30c8\u3068\u3057\u3066\u767b\u9332\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>Route::get('item_image', function(){<\/strong>\r\n\r\n<strong>    return view('item_image');<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067<code>http:\/\/******\/item_image<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5438\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_3.png\" alt=\"\" width=\"343\" height=\"480\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_3.png 343w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_3-214x300.png 214w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/p>\n<p>\u3046\u307e\u304f\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3067\u306f\u3001\u3053\u306e\u753b\u50cf\u306eURL\u3092\u30b3\u30d4\u30fc\u3057\u3066\uff11\u5206\u5f8c\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\uff08\uff11\u5206\u5f8c\u30fb\u30fb\u30fb\u23f3\uff09<\/p>\n<p>&nbsp;<\/p>\n<p><code>F5<\/code>\u30ad\u30fc\u3092\u62bc\u3057\u3066\u30ea\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5439\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_4.png\" alt=\"\" width=\"780\" height=\"296\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_4.png 780w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_4-300x114.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/12\/protect_image_4-768x291.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/p>\n<p>\u306f\u3044\uff01<br \/>\n\u3046\u307e\u304f\u6709\u52b9\u671f\u9650\u5207\u308c\u306e\u5224\u65ad\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u3067\u753b\u50cf\u306e\u76f4\u30ea\u30f3\u30af\u3092\u7981\u6b62\u3059\u308b\u65b9\u6cd5\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u53b3\u5bc6\u306b\u306f\u3001\u8868\u793a\u5f8c\u306b\u7279\u5b9a\u306e\u671f\u9593\uff08\u4eca\u56de\u306f\uff11\u5206\uff09\u306f\u76f4\u30ea\u30f3\u30af\u3092\u30d6\u30ed\u30c3\u30af\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u3059\u3054\u304f\u77ed\u3044\u6642\u9593\u3060\u3051\u306a\u306e\u3067\u76f4\u30ea\u30f3\u30af\u3092\u8cbc\u308b\u5074\u304b\u3089\u3059\u308b\u3068\u3001\u3042\u307e\u308a\u30e1\u30ea\u30c3\u30c8\u304c\u306a\u304f\u306a\u308a\u7d50\u679c\u76f4\u30ea\u30f3\u30af\u3092\u6e1b\u3089\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u30b5\u30a4\u30c8\u3067\u3082\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-427 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/24.png\" alt=\"\" width=\"182\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/24.png 182w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/04\/24-171x300.png 171w\" sizes=\"auto, (max-width: 182px) 100vw, 182px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593 \u610f\u5916\u3068\u7c21\u5358\uff01Laravel\u3067gif\u30a2\u30cb\u30e1\u3092\u3064\u304f\u308b \u306a\u3069\u3001\u3044\u304f\u3064\u304b\u753b\u50cf\u306b\u95a2\u9023\u3059\u308b\u8a18\u4e8b\u3092\u516c\u958b\u3057\u307e\u3057\u305f\u3002 \u305d\u3057\u3066\u3001\u305d\u308c\u3089\u306e\u8a18\u4e8b\u306f\u753b\u50cf\u81ea\u4f53\u3092\u3064\u304f\u3063\u305f\u308a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=5431\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3059\u3050\u3067\u304d\u308b\uff01Laravel\u3067\u753b\u50cf\u306e\u76f4\u30ea\u30f3\u30af\u3092\u7981\u6b62\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":5443,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[83],"class_list":["post-5431","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-83"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5431","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=5431"}],"version-history":[{"count":5,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5431\/revisions"}],"predecessor-version":[{"id":5444,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/5431\/revisions\/5444"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/5443"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}