25 lines
588 B
PHP
25 lines
588 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Fo;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Jobs\IncrementUrlStat;
|
|
use App\Models\Url;
|
|
|
|
class UrlController extends Controller
|
|
{
|
|
/**
|
|
* Redirect an url to its value.
|
|
*
|
|
* @param \App\Models\Url $url
|
|
*
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
*/
|
|
public function redirect(Url $url)
|
|
{
|
|
IncrementUrlStat::dispatch($url)->onConnection('database')->onQueue('database');
|
|
|
|
return \redirect($url->value, 301)
|
|
->header('Cache-Control', 'no-store, no-cache, must-revalidate');
|
|
}
|
|
}
|