Adding social media registration and login to laravel application.

Registration & Login using Social Media in Laravel (Socialite Package)

With the growing usage of social media, Social Media Registration and authentication are important for any web applications. The advantage of having them is users can Register/Login into your application with the click of a button and don’t have to remember a new credential for the application.

In this blog, you will look into integrating social media Registration/Login in your Laravel application using Laravel Official package – Socialite.

Read more…

Adding custom attributes to Select field in laravelcollective HTML

Most of the time we use HTML select without any custom attributes. But in some cases adding custom attributes like data-* helps to easily access extra data related to the Option selected without making additional ajax call.

LaravelCollective HTML is an awesome package to created HTML forms in Laravel. It provides a lot of features to help to build simple and complex forms.

If you wanted to add some custom attributes in Select-Option tag, that is something like this:

Read more…

Laravel: Ajax CRUD operation in Resource Controller

Laravel: Demo Ajax CRUD operation in Resource Controller

Laravel provides Resource Controller which is very helpful for performing CRUD (Create, Read, Update, Delete) operation for resources (like Photos, Brands, Categories etc).

CRUD Routes for resource controller can be added with just a single line of code. Also, if you want to have partial resource routes it can be easily done with only or except attributes.
Read more…

environment-variable-best-way-save-configuration-variables-php-application

Environment variables: Best way to save configuration variables in a PHP application

Introduction

Almost all PHP application use configuration variables to store configurations; like database credentials, memcache details, 3rd part api details and many others.

According to The Twelve-factor App all these config should Never be committed to SCM and developers should keep it separate from codebase. Further they suggest that config should be stored in environment variables (env vars or env).

Read more…

display-user-devices-application-currently-logged-option-logout-laravel

Display user devices there application is currently logged in and option to logout in Laravel

Often users login into an application from multiple devices, but forget to logout. Or sometimes they want to logout from a particular devices because of any reason whatsoever or they want to check the devices their application is currently logged in.

You might have seen similar features in facebook, twitter and many other applications, which allows you to see all browsers and devices from which you are currently logged in with options to logout from that device.

In this post we will look into implementing this feature in our Laravel application using session.

Read more…

Adding extra conditions in default Laravel Authentication

Different ways to add extra conditions in Laravel 5.2 Authentication

Adding extra conditions in default Laravel Authentication

Laravel comes with a very simple yet powerful authentication system out-of-box. The Authentication system is HIGHLY flexible to meet all different types of requirement for authentication.

In this post we will see about adding extra conditions to default Laravel authentication i.e for example add a check for is_approved when a user login.
Read more…