Skip to main content

Call to a member function map() on array

 I have faced this when i have used:

return  $request->clients->map(function($client){
            return $client;
        });


it showed Call to a member function map() on array error.

So to solve this I have used: 

return  collect($request->clients)->map(function($client){
            return $client;
        });


Comments

Popular posts from this blog