<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Rating extends Model {

    public $table = 'ratings';
    public $primaryKey = 'id';

    protected $fillable = [
        'user_id', 'rate', 'type', 'company_id'
    ];
    public function latest($column = 'updated_at')
    {
        return $this->orderBy($column, 'desc');
    } 
}
