<?php

function getMedia($path)
{
    try {
        $mediaPath = config('app.AWS_S3_URL') . $path;
    } catch (\Exception $ex) {
        $mediaPath = '';
    }

    return $mediaPath;
}

function truncateString($string, $limit)
{
    if (strlen($string) > $limit) {
        return substr($string, 0, $limit) . '.....';
    } else {
        return $string;
    }
}
