Decoding Laravel : Eloquent touch()

laravel eloquent touch

Today we are going to see about laravel eloquent touch method. Touch touch() is a method offered by eloquent that is used to update the updated_at field on the database table for the given model. For example, if you have a login system and you wanted to update the updated_at field whenever a user logs in (as last login), then you do this by $user->touch(). Laravel updates the updated_at field to current date and time.
Read more

Decoding Laravel Validation : $this->validate()


Recently, while working on one of my project, I was wondering how laravel $this->validate() works under the hood. So I decided to dig deep into laravel core to find its implementation. Upon finding, it persuaded me to start a series called “Decoding Laravel”. So from now on, I’m planning to publish once in a while explaining about core functionalities of laravel. Today, we are going to decode laravel validation ($this->validate()) method. I’m using laravel 5.4 for this article.
Read more

Automatic Facebook Login With Laravel and Vue Js

automatic facebook login

Laravel socialite provides a nice wrapper for implementing Facebook social login in laravel framework. However, wouldn’t it be cool to perform automatic Facebook login to our user if he has already logged in once previously? Recently, while working on one of my project, I stumbled upon this scenario and I achieved this easily using Vue. So, here I’m going to walk you through step by step procedure to achieve the same.
Read more

Registering Custom Exception Handler in Laravel 5

In this article I’m going to guide you on how to register the custom exception handler in laravel. There might be a situation where you needed separate exception handler instead of default one like module based development. So, I’m going to help you in registering your first custom exception handler in laravel. Let’s get started
Read more

Database Migrations from Custom Directory on Laravel 5.3+

While working on one of my projects, I wanted the database migration file to be placed in a separate folder rather having them all under the same database/migrations folder. A quick browse through laravel documentation showed that you could achieve that from laravel 5.3+. Let’s see how to handle this.
Read more