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…