app/Http/Requests/StoreSurveyRequest.php
/**
     * Prepare the data for validation.
     *
     * @return void
     */
Prepare the data for validation.
@return void
Prepare the data for validation . @return void
protected function prepareForValidation()
    {
        $this->merge([
            'user_id' => $this->user()->id
        ]);
    }
protected function prepareForValidation ( ) { $ this -> merge ( [ 'user_id' => $ this -> user ( ) -> id ] ) ; }
Prepare the data for validation.
Prepare the data for validation .