Decorator in Node – is it possible to iterate through class methods inside the constructor in order to override / apply a decorator to them

Up front I’m new to Node / Javascript an. What I am trying to do is to add a logging to my repository using a decorator function. Therefor I’m trying to iterate though each function from inside the constructor and override it with something like: “
Object.getOwnPropertyNames(Repository.prototype).forEach((func) => this.decorator(func));”
My problem is that “Object.getOwnPropertyNames” only returns the function names instead of the actual function. Is there a way to apply this decorator to each function?

Laravel View Composer with Repository is not working;

I’m using a package with cities and countries in my Laravel project. I set up a repository pattern to use this cities data. My plan is to send the cities data to the register view or any other view I want. In the example here I want to send to the project.create page. I tested the repository and when I look through the controller, I can pass the data to the view and print it with dd(). There is no problem with this. Now I want to send this data to a view i want via viewcomposer.

Laravel4: Will not using the repository pattern hurt my project in the long run?

I’m reading Taylor Otwell’s book in which he suggests using the repository pattern. I get the theory behind it. That it’s easy to switch implementations and decouples your code. I get the code too. And it is very nice to be able to switch by App::bind() with some other implementation. But I’ve been thinking for the last two hours how I should approach things for a new CRM I’m building. Almost no code yet but it might end up big.

Using ApplicationDbContext in Repository Pattern

I want to implement repository pattern in my ASP.NET MVC project. I’ve seen a lot of implementations when searching google and I’m a little bit confused. Most of them created their own Context class which inherited from DBContext class and then injected it in a repository (or repositories) constructor.
None of the articles I found explain why the custom DBContext class is created and why they just don’t use default ApplicationDbContext and HOW to change your app code to adapt to the new Context class. They don’t even mention the class.