title: Laravel 4: how do I check if a database entry already exists against my store function
body: <p>I'm adding posts to a database using a PostsController in Laravel 4</p>
  
  <p>I use a url field in the database to determine what I use for the show post url e.g. url = example-url will mean the post's url will be example.com/example-url</p>
  
  <p>My store function looks like this:</p>
  
  <pre><code>public function store()
  {
          $input = Input::all();
  
          $v = Validator::make($input, Post::$rules);
  
          if($v-&gt;passes())
          {
              $this-&gt;post-&gt;create($input);
  
              return Redirect::route('cms.index');
          }
  
          return Redirect::route('cms.create')
              -&gt;withInput()
              -&gt;withErrors($v)
              -&gt;with('message', 'There were validation errors.');
  }
  </code></pre>
  
  <p>What is the best way to check if the url entered already exists for another post?</p>
  
  <p>Thanks!</p>