title: Laravel Voyager /admin not working after routes to pages defined
body: <p>I made it so that I can access pages other than the index. This works perfectly. In the admin panel I can view every page except <code>/admin</code>. So I can view the <code>/admin/posts</code> and <code>/admin/media</code> page etc etc.</p>
  
  <p>I am getting the error </p>
  
  <blockquote>
    <p>Trying to get property of non-object</p>
  </blockquote>
  
  <p>It references this line in my show.blade:</p>
  
  <pre><code>&lt;header class="masthead" style="background-image: url('/storage/{{ $page-&gt;image }}')"&gt;
  </code></pre>
  
  <p>I understand it is because there is no <code>$page-&gt;image</code> object, and believe <code>/admin/something</code> is being treated as a post, where as <code>/admin</code> is a page and so it trying to look for this not existent object?</p>
  
  <p>What I am wanting is for the <code>/admin</code> page to load as it did previously, while retaining the functionality that the <code>pages/show.blade.php</code> provides throughout the front end of the website. So pretty much for my existing code not to consider <code>/admin</code>.</p>
  
  <p>I did try </p>
  
  <pre><code>$host = $_SERVER['REQUEST_URI'];
  if($host !== '/admin') 
  {
      my show.blade.php content here
  }
  </code></pre>
  
  <p>But this still doesn't escape that the admin page is being treated as a page and so is still looking at the show.blade file and so it leaves me needing to create a custom <code>/admin</code> page and I would rather for now stick with the out of the box voyager admin page.</p>
  
  <p>routes:</p>
  
  <pre><code>Route::get('/', 'TrainController@index');
  
  Route::get('post/{slug}', 'TrainController@show');
  Route::get('{slug}', 'PagesController@show');
  
  
  Route::group(['prefix' =&gt; 'admin'], function () {
      Voyager::routes();
  </code></pre>
  
  <p>PagesController</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\Page;
  use Illuminate\Http\Request;
  
  class PagesController extends Controller
  {
      public function show($slug)
      {
          $page = Page::findBySlug($slug);
          return view('page.show', ['page' =&gt; $page]);
      }
  }
  </code></pre>
  
  <p>Pages Model</p>
  
  <pre><code>&lt;?php
  
  namespace App;
  
  use Illuminate\Database\Eloquent\Model;
  
  class Page extends Model
  {
      public static function findBySlug($slug)
      {
          return static::where('slug', $slug)-&gt;first();
      }
  }
  </code></pre>
  
  <p>pages/show.blade.php</p>
  
  <pre><code>@extends('layouts.index')
  
  @section('header')
  
  
  &lt;!-- Page Header --&gt;
  &lt;header class="masthead" style="background-image: url('/storage/{{ $page-&gt;image }}')"&gt;
      &lt;div class="overlay"&gt;&lt;/div&gt;
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-8 col-md-10 mx-auto"&gt;
                  &lt;div class="page-heading"&gt; &lt;h1&gt;{!! $page-&gt;title !!}&lt;/h1&gt;
                      &lt;span class="subheading"&gt;&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/header&gt;
  
  @stop
  
  @section('content')
  
  &lt;!-- Main Content --&gt;
  
      &lt;div class="container"&gt;
          &lt;div class="row"&gt;
              &lt;div class="col-lg-8 col-md-10 mx-auto"&gt;
                  {!! $page-&gt;body !!}
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
  
  @stop
  </code></pre>