title: laravel and vue, loading view without expected prop
body: <p>I asked a question about this earlier but I'm still stuck and having some issues.</p>
  
  <p>Right now, if I go to site.com/status/12345 then I will get my status as I would expect. The route with the id (12345) hits a controller method which passes that id in and returns the json version of it in the view, where I'm using it as a prop and calling a function with it on page load.</p>
  
  <p>However, if I just go to site.com/status (which should hit my index method, returning only the base view) then I get 'undefined variable entryKey'.</p>
  
  <p>Obviously, I'm adding my entryKey value from the controller into my blade to be passed in as a prop, which seems to be working if there is a URL segment for it, but now I can't just get my base view to return with <code>site.com/status</code></p>
  
  <p>How can I fix this so that <code>site.com/status</code> hits my index method and <code>site.com/status/12345</code> hits the detail method and passes the id in as a prop?</p>
  
  <p>web.php (routes)</p>
  
  <pre><code>Route::get('/entry/status', 'entry\entryController@index')
      -&gt;name('entry.status');
  Route::get('/entry/status/{id}', 'entry\entryController@details')
      -&gt;name('entry.status');
  </code></pre>
  
  <p>controller.php</p>
  
  <pre><code>public function index() {
  
      return view('entry.status');
  }
  
  public function details($id) {
  
      if (request()-&gt;wantsJson()) {
          return json_encode(entry::getDetails($id));
      }
  
      $entryID = json_encode($id);
      return view('entry.status')
          -&gt;with('entryKey', $entryID);
  }
  </code></pre>
  
  <p>status.blade.php</p>
  
  <pre><code> &lt;entry-dashboard :entry-key="{{$entryKey}}"&gt;&lt;/entry-dashboard&gt;
  </code></pre>
  
  <p>detail.vue</p>
  
  <pre><code>props: [
  'entryKey'
  ],
  created() {
    this.setDetailWindow(this.entryKey);
  },
  setDetailWindow(event) {
  
    this.detailId = event.taskt_id;
  
    axios.get('/entry/status/' + this.detailId)
      .then(response =&gt; {
      ...
      ...
  }
  </code></pre>