title: How to retrieve the view name in Laravel 5?
body: <p>I've tried a variety of ways, including the popular post here: <a href="https://stackoverflow.com/questions/36922644/add-view-name-to-css-class-on-body">Add View Name to CSS Class on Body</a></p>
  
  <p>But it pulls up the master template, rather than the sub-template name. I use @yield and @extends and such. So at the moment this is what a part of my file system looks like in my views:</p>
  
  <pre><code>-Views
  --Layouts
  ---=master.blade.php
  --Shipments
  ---=index.blade.php
  </code></pre>
  
  <p>So my shipments.index file will @extends('layouts.master'), just so I don't have so much redundancy. However, referencing the above post, I get the following result:</p>
  
  <p><code>&lt;div id="page" class="layouts.master"&gt;</code></p>
  
  <p>which is not what I'd like, I'd prefer at the very least "shipments.index", I don't mind if it's longer, I just want it identified.</p>