<?php
if (!isset($bodyClass) || empty($bodyClass)) {
  $bodyClass = '';
}
if (!isset($head) || empty($head)) {
  $head = 'layouts.head';
}
?>
<!DOCTYPE html>
<html>
  <head>
    @include($head)
    <title>@yield('title')</title>
  </head>
  <body class="{{ $bodyClass }}" >
    @yield('body')
  </body>
</html>

<?php
if (!isset($bodyClass) || empty($bodyClass)) {
  $bodyClass = '';
}
if (!isset($head) || empty($head)) {
  $head = 'layouts.head';
}
?>
<!DOCTYPE html>
<html>
  <head>
    @if (view()->exists($head))
      @include($head)
    @endif
    <title>@yield('title')</title>
  </head>
  <body class="{{ $bodyClass }}" >
    @yield('body')
  </body>
</html>

Check if head view exists before include it
Check if head view exists before include it
