public function log($text, $userId = '', $attributes = [])
    {
        Activity::create(
            [
                'text' => $text,
                'user_id' => ($userId == '' ? null : $userId),
                'ip_address' => $attributes['ipAddress'],
            ]
        );

        return true;
    }
public function log($text, $userId = '', $attributes = [])
    {
        Activity::create(
            [
                'text' => $text,
                'user_id' => ($userId == '' ? null : $userId),
                'ip_address' => $attributes['ipAddress'],
            ]
        );

        return true;
    }
public function log ( $ text , $ userId = '' , $ attributes = [ ] ) { Activity :: create ( [ 'text' => $ text , 'user_id' => ( $ userId == '' ? null : $ userId ) , 'ip_address' => $ attributes [ 'ipAddress' ] , ] ) ; return true ; }
Log activity in an Eloquent model.

@param string $text
@param $userId
@param array  $attributes

@return bool
Log activity in an Eloquent model .