mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Actions\Links;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use JetBrains\PhpStorm\NoReturn;
|
|
|
|
class CreateLinkAction extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*/
|
|
#[NoReturn]
|
|
public function __invoke(Request $request): void
|
|
{
|
|
$validated = $request->validate([
|
|
'url' => ['required', 'string', 'url'],
|
|
'product_id' => ['sometimes', 'integer', 'exists:products,id'],
|
|
'name' => ['nullable', 'string', 'max:255'],
|
|
'price_desired' => ['nullable', 'numeric'],
|
|
'percentage_drop' => ['nullable', 'numeric'],
|
|
'lowest_within' => ['nullable', 'numeric'],
|
|
'extra_costs_amount' => ['nullable', 'numeric'],
|
|
'extra_costs_percentage' => ['nullable', 'numeric'],
|
|
'is_in_stock' => ['nullable', 'boolean'],
|
|
'is_official' => ['nullable', 'boolean'],
|
|
'is_shipping_included' => ['nullable', 'boolean'],
|
|
'any_price_change' => ['nullable', 'boolean'],
|
|
]);
|
|
|
|
dd($validated);
|
|
|
|
}
|
|
}
|