TypeError ReflectionFunction::__construct() expects parameter 1 to be string, array given
Please read our Disclaimer
Works With
-Laravel Framework 8.16.0
After a long hiatus, I’ve jumped from Laravel 5.8.30 to Laravel 8.16.0 to update my tools and that’s almost three (3) major versions I’ve missed. With a busy schedule I could not spare time to go through the change logs. And so it happens.
![](https://i0.wp.com/mangyfoil.com/wp-content/uploads/2020/11/Laravel-TypeError-ReflectionFunction-Stack-Trace.png?resize=1024%2C753)
Prior the 8.16.0 migration, I’ve used to create my routes like the one shown below:
![](https://i0.wp.com/mangyfoil.com/wp-content/uploads/2020/11/Laravel-TypeError-ReflectionFunction-5.8.30-web-route.png?resize=837%2C593)
As it turned out, the problem was caused by an invalid route construct. On the latest Laravel version (or this 8.16.0), the route construct should be rewritten to as follows:
![](https://i0.wp.com/mangyfoil.com/wp-content/uploads/2020/12/Laravel-TypeError-ReflectionFunction-8.16.0-web-route.png?resize=1024%2C438)
Though I might have missed some very important change nevertheless this fixed my error.
HTH