{"id":725,"date":"2019-05-12T11:54:03","date_gmt":"2019-05-12T02:54:03","guid":{"rendered":"https:\/\/dennie.tokyo\/it\/?p=725"},"modified":"2019-07-07T12:45:30","modified_gmt":"2019-07-07T03:45:30","slug":"blade%e3%83%86%e3%83%b3%e3%83%97%e3%83%ac%e3%83%bc%e3%83%88-%e5%88%b6%e5%be%a1%e6%a7%8b%e6%96%87%e8%b6%85%e5%85%a5%e9%96%80-laravel5-8","status":"publish","type":"post","link":"https:\/\/dennie.tokyo\/it\/?p=725","title":{"rendered":"Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u5236\u5fa1\u69cb\u6587\u8d85\u5165\u9580 Laravel5.8"},"content":{"rendered":"<div class=\"overview_box\">\n<a href=\"https:\/\/dennie.tokyo\/it\/?p=784\" rel=\"noopener noreferrer\" target=\"_blank\">\u524d\u56de<\/a>\u306f\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<!--more--><br \/>\n\u4eca\u56de\u306f\u5236\u5fa1\u69cb\u6587\u3092\u884c\u3046\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u5b9f\u4f8b\u3068\u5171\u306b\u8aac\u660e\u3057\u307e\u3059\u3002\n<\/div>\n<h5 class=\"title\">\u524d\u63d0<\/h5>\n<div class=\"sub_title\">\u30d5\u30a1\u30a4\u30eb\u69cb\u6210<\/div>\n<div class=\"sentence_box\">\n\u30d5\u30a1\u30a4\u30eb\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\n<\/div>\n<div class=\"sentence_box\" style=\"margin-top:40px;\">\n<table class=\"table\">\n<thead>\n<tr>\n<th scope=\"col\">\u30d5\u30a1\u30a4\u30eb\u540d<\/th>\n<th scope=\"col\">\u8aac\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>resources\/views\/layouts\/main.blade.php<\/td>\n<td>\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<tr>\n<td>resources\/views\/if\/if.blade.php<\/td>\n<td>\u30b3\u30f3\u30c6\u30f3\u30c4\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<tr>\n<td>routes\/web.php<\/td>\n<td>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30d5\u30a1\u30a4\u30eb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"sub_title\">\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb<\/div>\n<div class=\"sentence_box\">\n\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\n<\/div>\n<pre class=\"lang:default decode:true \" >&lt;html&gt;\r\n    &lt;head&gt;&lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;main&gt;\r\n          @yield('content')\r\n        &lt;\/main&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<div class=\"sub_title\">\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0<\/div>\n<div class=\"sentence_box\">\n\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \" title=\"web.php\" >Route::get('\/if', function () {\r\n    return view('if.if');\r\n});<\/pre>\n<h5 class=\"title\">\u57fa\u672c<\/h5>\n<div class=\"sentence_box\">\n@if\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306f\u3001php\u306e\u5236\u5fa1\u69cb\u6587\u3068\u540c\u3058\u3067\u3059\u3002\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"if.blade.php\" >@extends('layouts.main')\r\n@php\r\n  $value = 1;\r\n@endphp\r\n\r\n@section('content')\r\n\r\n  &lt;h1&gt;IF\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u4f8b&lt;\/h1&gt;\r\n  @if ($value === 1)\r\n    &lt;h2&gt;TOP&lt;\/h2&gt;\r\n  @elseif ($value === 2)\r\n    &lt;h2&gt;MAIN&lt;\/h2&gt;\r\n  @else\r\n    &lt;h2&gt;OTHER&lt;\/h2&gt;\r\n  @endif\r\n\r\n@endsection\r\n<\/pre>\n<h5 class=\"title\">unless<\/h5>\n<div class=\"sentence_box\">\nfalse\u5224\u5b9a\u3059\u308b\u306b\u306f\u3001@unless\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3082\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306f\u3001@if\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u3068\u3001@unless\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u4f7f\u7528\u3057\u305f\u5834\u5408\u306e\u4f8b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3069\u3061\u3089\u3082\u540c\u3058\u7d50\u679c\u306b\u306a\u308a\u307e\u3059\u3002\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"if.blade.php\" >@extends('layouts.main')\r\n@php\r\n  $unlessValue = false;\r\n@endphp\r\n\r\n@section('content')\r\n\r\n  &lt;h1&gt;UNLESS\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306e\u4f8b&lt;\/h1&gt;\r\n  @if(!$unlessValue)\r\n    &lt;h2&gt;if\u5224\u5b9a\u3092\u4f7f\u7528\u3057\u305f\u3088\u3002&lt;\/h2&gt;\r\n  @endif\r\n  @unless ($unlessValue)\r\n    &lt;h2&gt;UNLESS\u3060\u3088\u3002&lt;\/h2&gt;\r\n  @endunless\r\n\r\n@endsection\r\n<\/pre>\n<h5 class=\"title\">empty,isset<\/h5>\n<div class=\"sentence_box\">\nempty\u3001isset\u3082\u4f7f\u7528\u51fa\u6765\u307e\u3059\u3002\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"if.blade.php\" >@extends('layouts.main')\r\n@php\r\n  $nullValue = null;\r\n  $set = true;\r\n@endphp\r\n\r\n@section('content')\r\n\r\n  &lt;h1&gt;ISSET\u306e\u4f8b&lt;\/h1&gt;\r\n  @isset($set)\r\n    &lt;h2&gt;\u305d\u306e\u5909\u6570\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u3066\u5024\u3082\u3042\u308b\u3088\u3002&lt;\/h2&gt;\r\n  @endisset\r\n\r\n  &lt;h1&gt;EMPTY\u306e\u4f8b&lt;\/h1&gt;\r\n  @empty($nullValue)\r\n    &lt;h2&gt;\u305d\u306e\u5909\u6570\u306fempty\u3060\u3088\u3002&lt;\/h2&gt;\r\n  @endempty\r\n\r\n@endsection\r\n<\/pre>\n<h5 class=\"title\">switch<\/h5>\n<div class=\"sentence_box\">\n@switch\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3067switch\u6587\u304c\u4f7f\u7528\u51fa\u6765\u307e\u3059\u3002\n<\/div>\n<pre class=\"lang:default decode:true \" title=\"if.blade.php\" >@extends('layouts.main')\r\n@php\r\n  $switchValue = 2;\r\n@endphp\r\n\r\n@section('content')\r\n\r\n  @switch($switchValue)\r\n    @case(1)\r\n      &lt;p&gt;\u5024\u306f1&lt;\/p&gt;\r\n      @break\r\n\r\n    @case(2)\r\n      &lt;p&gt;\u5024\u306f2&lt;\/p&gt;\r\n      @break\r\n\r\n    @default\r\n      &lt;p&gt;\u5024\u306f\u3069\u308c\u3067\u3082\u306a\u3044&lt;\/p&gt;\r\n\r\n@endswitch\r\n\r\n@endsection\r\n<\/pre>\n<h5 class=\"title\">\u307e\u3068\u3081<\/h5>\n<div class=\"sentence_box\">\n\u6b21\u56de\u306f\u5909\u6570\u306b\u6307\u5b9a\u3055\u308c\u305f\u5024\u3092\u753b\u9762\u306b\u8868\u793a\u3057\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/dennie.tokyo\/it\/?p=826\" rel=\"noopener noreferrer\" target=\"_blank\">Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u30c7\u30fc\u30bf\u5c55\u958b<\/a>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306f\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u306b\u3064\u3044\u3066\u8aac\u660e\u3057\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"author":1,"featured_media":968,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,4],"tags":[],"class_list":["post-725","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","category-php"],"_links":{"self":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=725"}],"version-history":[{"count":33,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/725\/revisions"}],"predecessor-version":[{"id":904,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/posts\/725\/revisions\/904"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=\/wp\/v2\/media\/968"}],"wp:attachment":[{"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dennie.tokyo\/it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}