laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Describe property without @comment

Open dmitrach opened this issue 4 years ago • 0 comments

Summary

The helper works only with @comment. But it doesn't work without comment. I would use it without comment.

class Users extends Model
{
    /**
     * Get User's full name.
     *
     * @return string
     */
    public function getFullNameAttribute(): string
    {
        return $this->first_name . ' ' .$this->last_name;
    }

    /**
     * Get User's short name.
     * Returns only first name.
     *
     * Ignore this description.
     *
     * @return string
     */
    public function getShortNameAttribute(): string
    {
        return $this->first_name;
    }
}

// => after generate models

/**
 * App\Models\Users
 * 
 * @property-read string $full_name Get User's full name.
 * @property-read string $short_name Get User's short name.
 * …
 */

dmitrach avatar May 19 '21 07:05 dmitrach