{"id":10585,"date":"2020-05-10T10:24:47","date_gmt":"2020-05-10T01:24:47","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=10585"},"modified":"2023-10-12T21:17:42","modified_gmt":"2023-10-12T12:17:42","slug":"%e3%80%90laravel%e3%80%91%e3%80%8cblade%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=10585","title":{"rendered":"\u3010Laravel\u3011\u300cBlade\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Blade\u3068\u306f\uff1f<\/h2>\n\n\n\n<p>laravel\u3067\u5229\u7528\u3067\u304d\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Blade\u306e\u30e1\u30ea\u30c3\u30c8<\/h2>\n\n\n\n<ul>\n<li>\u51e6\u7406\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u5074\u306b\u4efb\u305b\u3066\u3001<span style=\"color: #ff0000;\"><strong>\u8868\u793a\u3060\u3051\u306b\u5c02\u5ff5<\/strong><\/span>\u3055\u305b\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/li>\n\n\n\n<li>\u5358\u72ec\u306ePHP\u306e\u5834\u5408\u306frequire\u7b49\u3067\u5916\u90e8PHP\u306e\u5185\u5bb9\u3092\u53d6\u5f97\u3057\u305f\u308a\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u304c\u3001blade\u306e\u5834\u5408\u306f\u5f8c\u8ff0\u3059\u308bBlade\u69cb\u6587\uff08@\u306e\u3064\u3044\u305f\u69cb\u6587\uff09\u3092\u4f7f\u7528\u3057\u3066\u308f\u304b\u308a\u3084\u3059\u304f\u8a18\u8ff0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Blade\u69cb\u6587\u306e\u7a2e\u985e<\/h2>\n\n\n\n<p>blade\u306e\u4e2d\u3067\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u72ec\u81ea\u69cb\u6587\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u69cb\u6587<\/th><th>\u8aac\u660e<\/th><\/tr><tr><td>@foreach \u301c @endforeach<\/td><td>\u914d\u5217\u3092\u30eb\u30fc\u30d7\u3055\u305b\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/td><\/tr><tr><td>@auth \u301c @endauth<\/td><td>\u8a8d\u8a3c\u6e08\u307f\u306e\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u306e\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/td><\/tr><tr><td>@guest \u301c @endguest<\/td><td>\u8a8d\u8a3c\u3057\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u5411\u3051\u306e\u51e6\u7406\u3092\u8a18\u8ff0\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/td><\/tr><tr><td>{{ $\u5909\u6570 }}<\/td><td><span style=\"color: #ff0000;\"><strong>PHP\u306e\u95a2\u6570\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u307e\u305f\u3001htmlspecialchars\u95a2\u6570<\/strong><\/span>\u3092\u901a\u3059\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u5909\u6570\u306e\u51fa\u529b\u306bXSS\u5bfe\u7b56\u3092\u5b9f\u65bd\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/td><\/tr><tr><td>{!! $\u5909\u6570 !!}<\/td><td>htmlspecialchars\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u305f\u304f\u306a\u3044\u5834\u5408\u306b\u4f7f\u3048\u307e\u3059\u3002\uff08\u5358\u306b\u666e\u901a\u306ePHP\u306eecho\u3067\u51fa\u529b\u3057\u305f\u5185\u5bb9\u3068\u540c\u3058\u306b\u306a\u308b\u3002\uff09<\/td><\/tr><tr><td>{-- \u30b3\u30e1\u30f3\u30c8 --}<\/td><td>\u30b3\u30e1\u30f3\u30c8\u3067\u304d\u307e\u3059\u3002<\/td><\/tr><tr><td>@csrf<\/td><td>\u8a18\u8ff0\u3059\u308b\u3060\u3051\u3067<span style=\"color: #ff0000;\"><strong>csrf\u5bfe\u7b56<\/strong><\/span>\u3092\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u7b49\u306b\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3067\u3057\u3087\u3046\u3002get\u4ee5\u5916\u3067\u306f\u5fc5\u305a\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/td><\/tr><tr><td>@method<\/td><td>form\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u3067get\u3068post\u3057\u304b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u3002<\/td><\/tr><tr><td>@extends(\u30ec\u30a4\u30a2\u30a6\u30c8)<\/td><td>\u5f8c\u8ff0\u3059\u308b\u7d99\u627f\u3059\u308b\u89aa\u30ec\u30a4\u30a2\u30a6\u30c8\u5b9a\u7fa9\u3092<span style=\"color: #ff0000;\"><strong>\u300c@extends('layout.app')\u300d<\/strong><\/span>\u3068\u8a18\u8ff0\u3059\u308b\u4e8b\u3067\u5b9f\u65bd\u3067\u304d\u307e\u3059\u3002<\/td><\/tr><tr><td>\n<div>\n<div>@yield('\u30bb\u30af\u30b7\u30e7\u30f3\u540d')<\/div>\n<\/div>\n<\/td><td>\n<div>\n<div>@section('\u30bb\u30af\u30b7\u30e7\u30f3\u540d')\u3067\u6307\u5b9a\u3057\u305f\u7b87\u6240\u3092\u8aad\u307f\u8fbc\u3080\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002<\/div>\n<\/div>\n<\/td><\/tr><tr><td>\n<div>\n<div>@error('\u30d5\u30a3\u30fc\u30eb\u30c9\u540dl')~@enderror<\/div>\n<\/div>\n<\/td><td>\u30d5\u30a9\u30fc\u30e0\u306e\u6307\u5b9a\u3057\u305f\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u3092\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3057\u307e\u3059\u3002<\/td><\/tr><tr><td>@include<\/td><td>\u4ed6\u306eblade\u30d5\u30a1\u30a4\u30eb\u3092\u547c\u3073\u8fbc\u307f\u307e\u3059\u3002<\/td><\/tr><tr><td>@section<\/td><td>\u300c@section('title', 'Page Title')\u300d\u3068\u6307\u5b9a\u3059\u308b\u3002\u7b2c\u4e00\u5f15\u6570\u3067HTML\u30bf\u30b0\u306a\u3069\u3092\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/td><\/tr><tr><td>@php<\/td><td>\n<pre class=\"lang:default decode:true \">@php\n&nbsp;php\u30b3\u30fc\u30c9\n@endphp<\/pre>\n<p>php\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002\u305f\u3060\u3057\u30d3\u30e5\u30fc\u304c\u6c5a\u304f\u306a\u308a\u5f97\u308b\u306e\u3067\u3042\u307e\u308a\u4f7f\u308f\u306a\u3044\u65b9\u304c\u826f\u3044\u3067\u3059\u3002<\/p><\/td><\/tr><tr><td>@dump<\/td><td>\u300c@dump(\u5909\u6570)\u300d\u306a\u3069\u3068\u4f7f\u3044\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u7528\u306b\u4f7f\u3044\u307e\u3059\u3002Laravel\u306edump\u30d8\u30eb\u30d1\u3068\u540c\u3058\u3067\u3059\u3002<\/td><\/tr><tr><td>@dd<\/td><td>\u300c@dd(\u5909\u6570)\u300d\u306a\u3069\u3068\u4f7f\u3044\u307e\u3059\u3002\u30c7\u30d0\u30c3\u30b0\u7528\u306b\u4f7f\u3044\u307e\u3059\u3002Laravel\u306edd\u30d8\u30eb\u30d1\u3068\u540c\u3058\u3067\u3059\u3002<\/td><\/tr><tr><td>@class<\/td><td>CSS\u306e\u30af\u30e9\u30b9\u3092\u6761\u4ef6\u4ed8\u304d\u3067\u9069\u7528\u3067\u304d\u307e\u3059\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u30ec\u30a4\u30a2\u30a6\u30c8\u5b9a\u7fa9<\/h2>\n\n\n\n<p>\u4e0b\u8a18\u306b\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u5b9a\u7fa9\u3057\u3066\u304a\u3051\u3070\u3053\u308c\u3092\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u3057\u3066\u30d5\u30ed\u30f3\u30c8\u306eHTML\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u5b9a\u7fa9\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">resources\/views\/layout\/app.blade.php<\/pre>\n","protected":false},"excerpt":{"rendered":"Blade\u3068\u306f\uff1f laravel\u3067\u5229\u7528\u3067\u304d\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30f3\u30b8\u30f3\u3067\u3059\u3002 Blade\u306e\u30e1\u30ea\u30c3\u30c8 Blade\u69cb\u6587\u306e\u7a2e\u985e blade\u306e\u4e2d\u3067\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306a\u72ec\u81ea\u69cb\u6587\u3092\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u53ef\u80fd\u3067\u3059\u3002 \u69cb\u6587 \u8aac\u660e @foreach \u301c @en [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[99],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10585"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10585"}],"version-history":[{"count":24,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10585\/revisions"}],"predecessor-version":[{"id":23646,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10585\/revisions\/23646"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10585"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}