title: How to create a word before function in a Laravel Model
body: <p>I have a list of countries in my database.</p>
  <p>I want to add the word &quot;<strong>THE</strong>&quot; before certain countries when needed.</p>
  <ul>
  <li><strong>Example:</strong> <strong>The</strong> Dominican Republic.</li>
  </ul>
  <p>How can I correct this to return the correct result? At the moment it is only returning the ELSE portion.</p>
  <hr />
  <p>This is in my Model: (<code>$this-&gt;name</code> returns the country names.)</p>
  <pre><code>    public function getTheCountryNameAttribute(){
          $the_country_name = [
                  'Dominican Republic', 'Bahamas'
          ];
          if($this-&gt;name == $the_country_name) {
              return 'the' . ' ' . $this-&gt;name;
          }else{
              return $this-&gt;name;
          }
      }
  </code></pre>
  <hr />
  <p>Output to view like this:</p>
  <pre><code>&lt;h3&gt;{{ $country-&gt;theCountryName }}&lt;/h3&gt;
  </code></pre>
  <hr />
  <p>If there is a better way with a Laravel helper I would love to see that option as well.</p>