DEV Community

loading...

Discussion on: Laravel Service Container

Collapse
patelparixit07 profile image
Parixit Patel Author

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
Collapse
avecnava profile image
avecNava

Many thanks.

Once I added the binding it worked.

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

There must have been some cache refresh issues.