title: How to prevent a wrong uuid with model injection binding?
body: <p>Using Laravel 6, I inject a model in a controller like this :</p>
  <pre><code>public function edit(School $school)
  {
      return view('/school/form', ['school' =&gt; $school]);
  }
  </code></pre>
  <p>All is working fine when I enter an url like this :</p>
  <pre><code>http://localhost:8000/schools/3d537a0f-4c74-4fae-99af-6f1b2c4b34c8/edit
  </code></pre>
  <p>But if I try another url like this one (with a wrong uuid):</p>
  <pre><code>http://localhost:8000/schools/3d537a0f-4c74-4fae-99af-6f/edit
  </code></pre>
  <p>Then I have this PostgreSQL error :</p>
  <blockquote>
  <p>SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid
  input syntax for type uuid: &quot;3d537a0f-4c74-4fae-99af-6f1b2c4b34c&quot;
  (SQL: select * from &quot;schools&quot; where &quot;id&quot; =
  3d537a0f-4c74-4fae-99af-6f1b2c4b34c limit 1)</p>
  </blockquote>
  <p>Does it mean that I have to check the uuid before ? Is there any elegant way to prevent this and to have an automatic redirection to a 404 page ?</p>