<?php

namespace DMZ\Models;
use DB;
use Illuminate\Database\Eloquent\Model;

class Albums extends Model
{
  protected $table ='albums';
  public $fillable = [
    'album', 
	'description', 
	'publish_up',
	'status',
	'created_by',
	'updated_by'
  ];
  public $timestamps = true;

  public function scopeGetSelectAlbums($query){
    return $query->where('status',1)->lists('album','id', 'album' );
  }
  public function scopeGetAlbums($query){
        return $query->select('albums.*')  
                     ->orderBy('publish_up', 'desc')
                     ->orderBy('created_at', 'desc');
  }
}
