count the number of elements that a request laravel 5.5 contains

1

I am trying to count the amount of data my Request brings but it returns the value 1, when in fact it contains 6 data.

    public function Guardar(Request $request)
{
    echo count($request);
}
    
asked by Andersson Meza Andrade 18.10.2017 в 19:25
source

1 answer

2

There are several ways to do it, maybe the simplest one is with the all () method, which usually lists the sent attributes:

count($request->all());
    
answered by 18.10.2017 / 19:32
source