PATH:
home
/
lab2454c
/
costbloc.com
/
app
/
Http
/
Requests
/
Site
<?php namespace App\Http\Requests\Site; use Illuminate\Foundation\Http\FormRequest; use Illuminate\Validation\Rule; class WishlistStoreRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'product_id' => ['required', 'exists:products,id', Rule::unique('wishlists', 'product_id') ->using(function ($q) { $q->where('user_id', auth()->user()->id); })], ]; } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'user_id' => auth()->user()->id, ]); } }
[-] OrderStoreRequest.php
[edit]
[-] WishlistStoreRequest.php
[edit]
[+]
..
[-] SellerRequest.php
[edit]
[-] StoreSellerRequest.php
[edit]