Skip to content

Commit

Permalink
Use dynamic link if enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jestillore committed Oct 3, 2019
1 parent f9622d7 commit feda5b5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/Factories/LinkFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ private static function formatLink($link_ending, $secret_ending=false) {
* @param boolean $secret_ending
* @return string
*/
$short_url = env('APP_PROTOCOL') . env('APP_ADDRESS') . '/' . $link_ending;

if (env('APP_DYNAMIC_LINK')) {
$request = app('request');
$host = $request->getScheme() . '://' . $request->getHost() . '/';
} else {
$host = env('APP_PROTOCOL') . env('APP_ADDRESS') . '/';
}

$short_url = $host . $link_ending;

if ($secret_ending) {
$short_url .= '/' . $secret_ending;
Expand Down

0 comments on commit feda5b5

Please sign in to comment.