loading...

re: Laravel Service Container VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi Parixit, Many thanks for the article, very beautifully explained. However, I got an error. It reads as ReflectionException Class App\Ser...
 

I guess there is something wrong with namespace and class name on MathService class. Hope you stored MathService class inside app/Services folder

Try to update this on MathService class :

namespace App\Services\MathService;
// To
namespace App\Services;

class AdhocMath
// To
class MathService
 

Many thanks.

Once I added the binding it worked.

App::bind('MathService',\App\Services\MathService::class);

There must have been some cache refresh issues.

Code of Conduct Report abuse