Search code examples
laravellaravel-4phpdoc

What should I put as the return value for the docblock in the Laravel 4 eloquent model class


I have the following basic class setup:

class Document extends Eloquent {

    /**
     * [types description]
     * @return [type] [description]
     */
    public function types() {
        return $this->belongsToMany('Type');
    }

}

What value would be appropriate to put in the return type doc block? Doing a var dump of the return method points the object \Illuminate\Database\Eloquent\Relations\BelongsToMany

Would that be correct in this instance? (I'm not really sure why if so?)

Thanks


Solution

  • The same Laravel is using:

    @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
    

    Take a look at the file

    vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php