{"id":8307,"date":"2021-08-26T06:04:15","date_gmt":"2021-08-26T06:04:15","guid":{"rendered":"https:\/\/www.scmgalaxy.com\/tutorials\/?p=8307"},"modified":"2021-08-26T06:04:17","modified_gmt":"2021-08-26T06:04:17","slug":"complete-referance-of-blade-in-laravel","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/","title":{"rendered":"Complete Referance of Blade in Laravel"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">What is Blade?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating engines, Blade does not restrict you from using plain PHP code in your templates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Blade template files use the <strong>.blade.php<\/strong> file extension and are typically stored in the resources\/views directory<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Blade Template<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Displaying Data &#8211;<\/strong> You may display data that is passed to your Blade views by wrapping the variable in curly braces.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Blade&#8217;s <strong>{{ }}<\/strong> echo statements are automatically sent through PHP&#8217;s htmlspecialchars function to prevent XSS attacks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:-<\/strong> {{$name}}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Calling Function \u2013 <\/strong>You may also echo the results of any PHP function by wrapping the function name in curly braces.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example:- <\/strong>{{ time( ) }}<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note &#8211;<\/strong> You can put any PHP code you wish inside of a Blade echo statement.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Comment<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Blade also allows you to define comments in your views. However, unlike HTML comments, Blade comments are not included in the HTML returned by your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{<strong>{&#8211; This comment will not be present in the rendered HTML &#8211;}}<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conditional Directives<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If Directive<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amardeep-devopsschool\/1dc49d98fb96650060717ef9d300c07c.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If.. Else.. Directive<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amardeep-devopsschool\/bc2ac61bedf000d683da066c370ae2d1.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>If\u2026 elseif\u2026 else\u2026 Directive<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amardeep-devopsschool\/51f31ee34fefdef3c2aeaa5a49d55095.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Empty Directive<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amardeep-devopsschool\/09d918ae478796a4b210faaadd4bad5b.js\"><\/script>\n\n\n\n<h2 class=\"wp-block-heading\">Authentication Directives<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Auth Directive<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amardeep-devopsschool\/cdab379e8c5d2a42c38638c9551b9313.js\"><\/script>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Guest Directive<\/strong><\/p>\n\n\n\n<script src=\"https:\/\/gist.github.com\/amardeep-devopsschool\/32822b659731374f1a816c434ab365ef.js\"><\/script>\n","protected":false},"excerpt":{"rendered":"<p>What is Blade? Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[5049],"tags":[5052,177],"class_list":["post-8307","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-laravel","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Complete Referance of Blade in Laravel - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Complete Referance of Blade in Laravel - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"What is Blade? Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2021-08-26T06:04:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-26T06:04:17+00:00\" \/>\n<meta name=\"author\" content=\"Amardeep Dubey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amardeep Dubey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/\"},\"author\":{\"name\":\"Amardeep Dubey\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/097cf9059af187b39521d8641650ddda\"},\"headline\":\"Complete Referance of Blade in Laravel\",\"datePublished\":\"2021-08-26T06:04:15+00:00\",\"dateModified\":\"2021-08-26T06:04:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/\"},\"wordCount\":197,\"commentCount\":0,\"keywords\":[\"laravel\",\"Php\"],\"articleSection\":[\"Laravel\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/\",\"name\":\"Complete Referance of Blade in Laravel - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2021-08-26T06:04:15+00:00\",\"dateModified\":\"2021-08-26T06:04:17+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/097cf9059af187b39521d8641650ddda\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/complete-referance-of-blade-in-laravel\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Complete Referance of Blade in Laravel\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/097cf9059af187b39521d8641650ddda\",\"name\":\"Amardeep Dubey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/79b318f73f1ee84d7678ea32f5af8984012529c7a67c2deb7e3030dc8c6114ba?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/79b318f73f1ee84d7678ea32f5af8984012529c7a67c2deb7e3030dc8c6114ba?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/79b318f73f1ee84d7678ea32f5af8984012529c7a67c2deb7e3030dc8c6114ba?s=96&d=mm&r=g\",\"caption\":\"Amardeep Dubey\"},\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/amardeep\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Complete Referance of Blade in Laravel - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/","og_locale":"en_US","og_type":"article","og_title":"Complete Referance of Blade in Laravel - scmGalaxy","og_description":"What is Blade? Blade is the simple, yet powerful templating engine that is included with Laravel. Unlike some PHP templating [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/","og_site_name":"scmGalaxy","article_published_time":"2021-08-26T06:04:15+00:00","article_modified_time":"2021-08-26T06:04:17+00:00","author":"Amardeep Dubey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Amardeep Dubey","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/"},"author":{"name":"Amardeep Dubey","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/097cf9059af187b39521d8641650ddda"},"headline":"Complete Referance of Blade in Laravel","datePublished":"2021-08-26T06:04:15+00:00","dateModified":"2021-08-26T06:04:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/"},"wordCount":197,"commentCount":0,"keywords":["laravel","Php"],"articleSection":["Laravel"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/","name":"Complete Referance of Blade in Laravel - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2021-08-26T06:04:15+00:00","dateModified":"2021-08-26T06:04:17+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/097cf9059af187b39521d8641650ddda"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/complete-referance-of-blade-in-laravel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Complete Referance of Blade in Laravel"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/097cf9059af187b39521d8641650ddda","name":"Amardeep Dubey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/79b318f73f1ee84d7678ea32f5af8984012529c7a67c2deb7e3030dc8c6114ba?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/79b318f73f1ee84d7678ea32f5af8984012529c7a67c2deb7e3030dc8c6114ba?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/79b318f73f1ee84d7678ea32f5af8984012529c7a67c2deb7e3030dc8c6114ba?s=96&d=mm&r=g","caption":"Amardeep Dubey"},"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/amardeep\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/8307","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=8307"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/8307\/revisions"}],"predecessor-version":[{"id":8308,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/8307\/revisions\/8308"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=8307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=8307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=8307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}