Category : request

I am using PHP 8.0.7, Laravel 8.41.0 and new to Laravel. Building some simple APIs. No issues with GET APIs but having trouble with POST. The $request object is always empty no matter what I did. It just returns []. I am posting below data in Fiddler : User-Agent: Fiddler Content-Type: application/json { "parent_id" = ..

Read more

I’m working on a large Laravel app, currently on v8.45.1 which has never had tests, so I’m working to get it to a point where we can start writing unit & feature tests. I’m hitting an issue where the two request classes (AppCoreRequest and AppCoreFormRequest) both use a trait RequestTrait which holds a set of ..

Read more

I want to get in the Request the field with an empty value, null or [ ] or whatever. The form field looks like this ->add(‘preferencia’, ChoiceType::class, [ ‘choices’ => [ ‘Catamaranes de vela’ => ‘Vela’, ‘Catamaranes de motor’ => ‘Motor’, ‘Trimaranes’ => ‘Trimaranes’, ], ‘expanded’ => true, ‘multiple’ => true, ‘mapped’ => false, ‘required’ ..

Read more

I’m trying to access this website natura.com.br to get info about some products, I’m trying to make a request the same way I do in the browser but I receive Access denied. <?php $url = "https://www.natura.com.br/"; $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X ..

Read more