Is it ok to register singleton in constructor instead of service provider? any drawback?
E.g. i have an abstract class
abstract class AbstractClassA
{
public function __construct()
{
app()->singleton(get_class($this), $this);
}
...
}
So that any class that extends it will automatically register singleton.
Tested working. Just curious any bug/issue if doing this