Laravel:如何为我的模型类设置限制,以便不能直接调用它?

The application I am working on has a wrapper(DAO) for each model class. The model itself is derived from Eloquent class. The issue is that junior developers keep calling methods like ModelClass:Where() or ModelClass::find() rather than using DAOClass:DaoMethod(). How can I restrict in my class that implementor of class can't do something like ModelClass::where()?

Thanks

The final keyword should do the trick. Just make all your desired DAOClass methods final. That way, once they are called from a class which extends your DAOClass, they will get a fatal error.