title: Laravel add function to model
body: <p>I want to add a function to a Laravel model like I'm used to in Rails. </p>
  
  <p>For example:</p>
  
  <pre><code>class Person &lt; ActiveRecord::Base
      def name
          "#{firstname} #{lastname}"
      end
  end
  </code></pre>
  
  <p>When I try to use the same approach in Laravel I get the following exception:</p>
  
  <pre><code>Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation
  </code></pre>
  
  <p>How do I get this behaviour in Laravel?</p>