<?php namespace App\Modules\Backend\Usergroups\Models;

use \App\Modules\Backend\Users\Models\User;
class UserGroup extends \Eloquent {

	/**
	 * The database table used by the model.
	 *
	 * @var string
	 */
	protected $table = 'user_groups';

	protected $fillable = array('name', 'permissions');

	public static function allOptions()
	{
		$options = array();
		$options = UserGroup::lists('name', 'id');
		return array_add($options, 0, '-'.trans('users::label.super_admin').'-');
		
	}

	public function users()
    {
    	$user = new User();
        return $this->hasMany($user, 'usergroup');
    }
}