beyondcode / laravel-comments

Add comments to your Laravel application
https://beyondco.de
MIT License
541 stars 90 forks source link

Extend comments model #8

Closed dambridge closed 7 months ago

dambridge commented 5 years ago

I'd like to override your comments model with my own, so that I may add some additional data when creating comments, either through setters, etc. What is the best approach to doing this?

mreduar commented 5 years ago

I did it this way

namespace App;

use BeyondCode\Comments\Comment as CommentSystem;
use Other\Trait\Name as NewTrait;

class Comment extends CommentSystem
{
    use NewTrait;
}