check() and $this->ajax(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'media' => Media::where('id', $this->media_id)->first() ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return [ 'media_id' => 'required|exists:media,id,deleted_at,NULL' ]; } }