init
This commit is contained in:
17
web10/app/Http/Controllers/OutboundController.php
Normal file
17
web10/app/Http/Controllers/OutboundController.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Product;
|
||||
|
||||
class OutboundController extends Controller
|
||||
{
|
||||
public function redirect(string $slug)
|
||||
{
|
||||
$product = Product::where('slug', $slug)->firstOrFail();
|
||||
$product->increment('click_count');
|
||||
$product->refreshHotScore();
|
||||
|
||||
return redirect()->away($product->website_url);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user