protected static function firstByAttributes($attributes)
	{
		$query = static::query();

		foreach ($attributes as $key => $value)
		{
			$query->where($key, $value);
		}

		return $query->first() ?: null;
	}
protected static function firstByAttributes($attributes)
	{
		$query = static::query();

		foreach ($attributes as $key => $value)
		{
			$query->where($key, $value);
		}

		return $query->first() ?: null;
	}
protected static function firstByAttributes ( $ attributes ) { $ query = static :: query ( ) ; foreach ( $ attributes as $ key => $ value ) { $ query -> where ( $ key , $ value ) ; } return $ query -> first ( ) ? : null ; }
Get the first model for the given attributes.

@param  array  $attributes
@return \Fly\Database\ActiveRecord\Model|null
Get the first model for the given attributes .