• Online JSON Diff Viewer

    Just came across this awesome tool to compare JSON. Yeah, at time it’s needed to compare them. Check this out(http://json-diff.com/) The thing I like most was the interface.

  • Develop your first Facebook messenger bot in PHP

    (Credit: Independent.co.uk) Facebook recently announced a Bot platform for it’s Messenger which provides businesses and individuals another way to communicate with people. What is a Chat bot? A computer program designed to simulate conversation with human users, especially over the Internet. Chat bot in PHP When I heard of it, my very first thought was to a bot in PHP. I started to find some SDK in this regard released by Facebook but none was present. I headed over to documentation which provided good information for starters. Ok! so without wasting further time, let’s build our first Bot Timebot In order to create an Fb bot you will need two things to…

  • How to remove local git branches?

    If you are working on a project having lots of feature branches, you’d like to remove all of once your deployment is done and all feature branches merge into master.  Following simple command can help you to get rid of them. git branch | grep 'DB-' | xargs git branch -d Here DB- is prefix of your feature branch. So, if you have branches like DB-1, DB-2; it will run grep branch and then grep all strings match DB- and then will remove them. xargs rule!

  • Laravel: How to avoid redirecting to home after login?

    If you are working on a Laravel 5.1 based project and using Auth class for authentication purpose, chances are you would have faced issue of redirecting to home after login. While docs say that you can override the behaviour by setting the $redirectedPath value. Thing is it will still not work. After wasting a reasonable time, I figured out the issue. By default Auth constructor is defined as:   public function __construct() { $this->middleware('guest', ['except' => 'getLogout']); } This middleware actually calls  RedirectIfAuthenticated trait. If you go to definition you will find:   public function handle($request, Closure $next) { if ($this->auth->check()) { return redirect('/home'); } return $next($request); } Hardcoded right.…

  • Tool to make inline CSS

    If you are going to send a CSS-based HTML mail aka Email Templates, chances are you are embedding CSS in <style> tag and end up having a bad experience of not having a properly rendered page. The issue is that web clients like Gmail etc strip markup tags. Specially <head><script> and <style> for security reasons. The only way is left to make HTML content with inline CSS. But.. making inline CSS is a pain in the neck and it’s not easy especially when are now used to making external CSS files or style blocks. Thankfully, Mailchimp provides a tool that takes your CSS and HTML and make it online. Try…

  • Templates in Laravel 5

    This post is part of LxD Series in which I share my learning process about different technologies. Learn more about LxD here. Ok you saw earlier the design we are going to use for our application. Now it’s time to integrate that design in our Laravel 5 application. Before I go further, let me tell directory structure of Laravel to integrate our design.   Layouts are actually part of views hence they reside in views folder. You have option to put all of your layouts within views->layouts folder or manage it better by dividing it into folders based on your site modules. For instance, Admin, Emails, Site etc. For my sake I created…

  • LxD Series: Laravel Basics

    Before we dive into coding Laravel based app, let’s learn what’s it all about. Laravel is an MVC based framework for rapid PHP based web application development. MVC(Model-View-Controller) is a design pattern used to write softwares. It consist of three parts: Model: This component deals with data and it’s manipulation. Usually you deal with database(RDBMS,NoSQL) here but this is not necessary at all. Your model could interact with a flat file or some remote API for data manipulation. View: The data which was processed or manipulated on model layer is shown by Views to end-users so that they could interact with the app. Controller: Controller actually sits between View and Model…

  • LxD Series: Initial Laravel App design

    I am extremely sorry. It took me a while to make this post. I got totally engaged in other things that made me to stay away from this. I am making this post, as a filler to end inertia. ٰIn previous post I discussed how to install and configure Laravel. In this post I am sharing a few screens of the web app we are going to build.   First screen will be a dashboard which users will see after logging in. Second is showing list of project while the third is entry form. In next couple of posts I will be discussing MVC basics and how Laravel implemented them. As…