<?php

namespace App\Models;

use App\Models\Product;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Author extends Model
{
    use HasFactory;

    public function product()
    {
        return $this->hasMany('App\Models\Product', 'author_id');
    }

    public function incrementClicks()
    {
        $this->increment('clicks');
    }
}
