src/app/http/controllers/HCURLShortenerController.php
public function redirect(string $shortURLKey)
    {
        $record = HCShortURL::where('short_url_key', $shortURLKey)->first();

        if (!$record)
            abort(404);

        $record->increment('clicks');

        return redirect($record->url);
    }
public function redirect(string $shortURLKey)
    {
        $record = HCShortURL::where('short_url_key', $shortURLKey)->first();

        if (!$record)
            abort(404);

        $record->increment('clicks');

        return redirect($record->url);
    }
public function redirect ( string $ shortURLKey ) { $ record = HCShortURL :: where ( 'short_url_key' , $ shortURLKey ) -> first ( ) ; if ( ! $ record ) abort ( 404 ) ; $ record -> increment ( 'clicks' ) ; return redirect ( $ record -> url ) ; }
Redirecting short URL to original URL

@param $shortURLKey
@return Redirect
Redirecting short URL to original URL