<?php

namespace App\Traits;



trait WithShareUrl
{


    /**
     * Get the share url. If none is defined on a content it will get the default link in configs
     *
     * @param  string  $value
     * @return string
     */
    public function getShareUrlAttribute($value)
    {
        if (!$value) {
            return !empty(config('api.default_share_link')) ? config('api.default_share_link') : '';
        }

        return $value;
    }
}
