You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.0 KiB

7 years ago
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Symfony\Component\ClassLoader\ClassMapGenerator;
use Illuminate\Database\Eloquent\SoftDeletes;
7 years ago
class Item extends Model
{
use SoftDeletes;
7 years ago
//
7 years ago
protected $fillable = [
'title', 'url', 'colour', 'icon', 'description', 'pinned', 'order'
7 years ago
];
/**
* The attributes that should be mutated to dates.
*
* @var array
*/
protected $dates = ['deleted_at'];
public static function supportedList()
{
return [
'NZBGet' => \App\SupportedApps\Nzbget::class,
'Plex' => \App\SupportedApps\Plex::class,
];
}
public static function supportedOptions()
{
return array_keys(self::supportedList());
}
/**
* Scope a query to only include pinned items.
*
* @param \Illuminate\Database\Eloquent\Builder $query
* @return \Illuminate\Database\Eloquent\Builder
*/
public function scopePinned($query)
{
return $query->where('pinned', 1);
}
7 years ago
}