<?php

namespace DMZ\Models;

use Illuminate\Database\Eloquent\Model;

class Documentos extends Model
{
  protected $table ='documentos';
  public $fillable = [
	'title',
	'description',
	'file',
	'size',
	'type',
	'hits',
	'publish_up',
	'status',
	'created_by',
	'updated_by'
  ];
  public $timestamps = true;

  public function scopeGetDocumentos($query){
        return $query->select('documentos.*') 
                     ->orderBy('publish_up', 'desc')
                     ->orderBy('created_at', 'desc');
  }
}
