mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
update costco crawler prepare for plugin integration increase file upload limit for livewire
30 lines
670 B
PHP
30 lines
670 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Models\Link;
|
|
use App\Services\URLParserService;
|
|
use Illuminate\Http\Request;
|
|
|
|
class GetLinkUsingUrlController extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*/
|
|
public function __invoke(Request $request, URLParserService $service)
|
|
{
|
|
$validated = $request->validate([
|
|
'url' => ['required', 'url', 'string'],
|
|
]);
|
|
|
|
$service->setup($validated['url']);
|
|
|
|
return Link::with(['store', 'store.currency'])
|
|
->firstWhere([
|
|
'store_id' => $service->store?->id,
|
|
'key' => $service->product_key,
|
|
]);
|
|
|
|
}
|
|
}
|