public static function log($data = array(), $recipients = array())
	{
		if (is_object($data))
		{
			$data = (array) $data;
		}

		if (is_string($data))
		{
			$data = array('description' => $data);

			$data['action'] = 'create';

			if (substr(strtolower($data['description']), 0, 6) == 'update')
			{
				$data['action'] = 'update';
			}

			if (substr(strtolower($data['description']), 0, 6) == 'delete')
			{
				$data['action'] = 'delete';
			}
		}

		try
		{
			$activity = self::blank()->set($data);

			if (!$activity->save())
			{
				return false;
			}

			if (!$activity->broadcast($recipients))
			{
				return false;
			}
		}
		catch (Exception $e)
		{
			return false;
		}

		return true;
	}
public static function log($data = array(), $recipients = array())
	{
		if (is_object($data))
		{
			$data = (array) $data;
		}

		if (is_string($data))
		{
			$data = array('description' => $data);

			$data['action'] = 'create';

			if (substr(strtolower($data['description']), 0, 6) == 'update')
			{
				$data['action'] = 'update';
			}

			if (substr(strtolower($data['description']), 0, 6) == 'delete')
			{
				$data['action'] = 'delete';
			}
		}

		try
		{
			$activity = self::blank()->set($data);

			if (!$activity->save())
			{
				return false;
			}

			if (!$activity->broadcast($recipients))
			{
				return false;
			}
		}
		catch (Exception $e)
		{
			return false;
		}

		return true;
	}
public static function log ( $ data = array ( ) , $ recipients = array ( ) ) { if ( is_object ( $ data ) ) { $ data = ( array ) $ data ; } if ( is_string ( $ data ) ) { $ data = array ( 'description' => $ data ) ; $ data [ 'action' ] = 'create' ; if ( substr ( strtolower ( $ data [ 'description' ] ) , 0 , 6 ) == 'update' ) { $ data [ 'action' ] = 'update' ; } if ( substr ( strtolower ( $ data [ 'description' ] ) , 0 , 6 ) == 'delete' ) { $ data [ 'action' ] = 'delete' ; } } try { $ activity = self :: blank ( ) -> set ( $ data ) ; if ( ! $ activity -> save ( ) ) { return false ; } if ( ! $ activity -> broadcast ( $ recipients ) ) { return false ; } } catch ( Exception $ e ) { return false ; } return true ; }
Create an activity log entry and broadcast it.

@param   mixed    $data
@param   array    $recipients
@return  boolean
Create an activity log entry and broadcast it .