title: Unknown Laravel Exception
body: <p>I'm setting up routes between my Vue.js app and Laravel. I've <a href="https://laracasts.com/discuss/channels/laravel/how-to-add-csrftoken-when-using-laravel-and-vue-resource?page=1" rel="nofollow noreferrer">setup CSRF with Vue.js</a>, but Laravel now throws the error below when I try and use my PageController@store method. It appears to be linked to the type hinting in my PageController: I removed all type hints, and this error disappeared. However, I wasn't getting any data returned.</p>
  
  <blockquote>
    <p>"message": "No query results for model [App\Page]."
    "exception": 
    Symfony\Component\HttpKernel\Exception\NotFoundHttpException",</p>
  </blockquote>
  
  <p>This is unexpected, as my store method only returns the request as JSON (I have also tried this with the store method empty).</p>
  
  <pre><code>/**
   * Store a newly created resource in storage.
   *
   * @param  \Illuminate\Http\Request  $request
   * @return \Illuminate\Http\Response
   */
  public function store(Request $request)
  {
      return response()-&gt;json($request);
  }
  </code></pre>
  
  <p>Here is my route:</p>
  
  <pre><code>Route::resource('/admin/resource/pages', 'PageController');
  </code></pre>
  
  <p>And lastly, here's my Vue.js method that sends the data to Laravel.</p>
  
  <pre><code>post (model){
      this.$http.put("/admin/resource/pages/store", {
          _method: "put",
          model: model
      }, {}).then(response =&gt; {
          console.log(response);
      });
  }
  </code></pre>
  
  <p>Any help is appreciated thank-you.</p>
  
  <p><strong>Full error stack:</strong></p>
  
  <pre><code>{
      "message": "No query results for model [App\\Page].",
      "exception": "Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException",
      "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php",
      "line": 200,
      "trace": [
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php",
              "line": 176,
              "function": "prepareException",
              "class": "Illuminate\\Foundation\\Exceptions\\Handler",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/app/Exceptions/Handler.php",
              "line": 49,
              "function": "render",
              "class": "Illuminate\\Foundation\\Exceptions\\Handler",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 83,
              "function": "render",
              "class": "App\\Exceptions\\Handler",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 55,
              "function": "handleException",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php",
              "line": 75,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php",
              "line": 49,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\View\\Middleware\\ShareErrorsFromSession",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php",
              "line": 63,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Session\\Middleware\\StartSession",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php",
              "line": 37,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php",
              "line": 66,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Cookie\\Middleware\\EncryptCookies",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 104,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
              "line": 681,
              "function": "then",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
              "line": 656,
              "function": "runRouteWithinStack",
              "class": "Illuminate\\Routing\\Router",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
              "line": 622,
              "function": "runRoute",
              "class": "Illuminate\\Routing\\Router",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Router.php",
              "line": 611,
              "function": "dispatchToRoute",
              "class": "Illuminate\\Routing\\Router",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
              "line": 176,
              "function": "dispatch",
              "class": "Illuminate\\Routing\\Router",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 30,
              "function": "Illuminate\\Foundation\\Http\\{closure}",
              "class": "Illuminate\\Foundation\\Http\\Kernel",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/fideloper/proxy/src/TrustProxies.php",
              "line": 57,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Fideloper\\Proxy\\TrustProxies",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
              "line": 31,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php",
              "line": 31,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php",
              "line": 27,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php",
              "line": 62,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 151,
              "function": "handle",
              "class": "Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php",
              "line": 53,
              "function": "Illuminate\\Pipeline\\{closure}",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php",
              "line": 104,
              "function": "Illuminate\\Routing\\{closure}",
              "class": "Illuminate\\Routing\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
              "line": 151,
              "function": "then",
              "class": "Illuminate\\Pipeline\\Pipeline",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php",
              "line": 116,
              "function": "sendRequestThroughRouter",
              "class": "Illuminate\\Foundation\\Http\\Kernel",
              "type": "-&gt;"
          },
          {
              "file": "/tempfiles/75/blog/public/index.php",
              "line": 55,
              "function": "handle",
              "class": "Illuminate\\Foundation\\Http\\Kernel",
              "type": "-&gt;"
          }
      ]
  }
  </code></pre>
  
  <p><strong>Page Controller:</strong></p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\Page;
  use Illuminate\Http\Request;
  
  class PageController extends Controller
  {
      /**
       * Display a listing of the resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function index()
      {
          // return response()-&gt;json(Page::all());
      }
  
      /**
       * Show the form for creating a new resource.
       *
       * @return \Illuminate\Http\Response
       */
      public function create()
      {
          //
      }
  
      /**
       * Store a newly created resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @return \Illuminate\Http\Response
       */
      public function store(Request $request)
      {
          return response()-&gt;json($request);
      }
  
      /**
       * Display the specified resource.
       *
       * @param  \App\Page  $page
       * @return \Illuminate\Http\Response
       */
      public function show(Page $page)
      {
          //
      }
  
      /**
       * Show the form for editing the specified resource.
       *
       * @param  \App\Page  $page
       * @return \Illuminate\Http\Response
       */
      public function edit(Page $page)
      {
      }
  
      /**
       * Update the specified resource in storage.
       *
       * @param  \Illuminate\Http\Request  $request
       * @param  \App\Page  $page
       * @return \Illuminate\Http\Response
       */
      public function update(Request $request, Page $page)
      {
          //
      }
  
      /**
       * Remove the specified resource from storage.
       *
       * @param  \App\Page  $page
       * @return \Illuminate\Http\Response
       */
      public function destroy(Page $page)
      {
          //
      }
  }
  </code></pre>