Using Trait in Laravel

Recently I got a chance to build a CRM system using Laravel and Backpack. When building the CRM, I learned how to use Trait in PHP. Trait is a feature introduced in PHP 5.4 that let you create a mixin class which can be added to any other class you want. It can’t be instantiated or extended, you simply use it. Literally, you just use it, and ev...
Click to read more ...

Use Middleware to restrict access to routes in Laravel

Sometimes you want to restrict users with certain roles to access certain routes. This is how I learned to do it with middleware. Consider the situation where you don’t want users with role user to access the following routes: “permission”, “user”, and “role”, only users with role admin can access them. In Laravel you can do this by creating a...
Click to read more ...

Acess Another Project's Config Settings with .NET Projects

When working with .NET projects, you will certainly come across the need to access another project’s configuration settings. Here are some tips on how to do it. Let’s say we have a solution that contains project A and B. B has a reference to A. In A we have two config fields: Config1 and Config2. In B we have two config fields as well: Config3 ...
Click to read more ...

Welcome/欢迎

I recently decided to start a blog. The purpose is not to be seen by many. It is just me forcing myself to keep track of things that are worth remembering. It could be some new techincal knowledege that I have learned, it could be some problems that I have enountered from work, or it could just be some key moments in my life. A lot of things h...
Click to read more ...