Sometimes, you don’t want that certain users can access to certain parts of the web, either because of their role, because they aren’t the creators or for whatever reason. Laravel has a feature that allows us to do this very easily, the so-called Middlewares. This is what we are going to try today, together with database field relationships with Eloquent ORM. So, we will learn to assign a post to its creator and then how to access that data.
Continue reading “Laravel 5.4 #7 : Middlewares and relationships with Eloquent ORM”