<?php

namespace DMZ\Models;

use Illuminate\Database\Eloquent\Model;

class Authorities extends Model
{
  protected $table ='authorities';
  public $fillable = [
	'id',
	'name',
	'lastname1',
	'lastname2',
	'position',
	'community',
	'movil',
	'email',
	'fb',
	'status',
	'publish_up',
	'created_by',
	'updated_by' 
  ];
  public $timestamps = true;

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