Send email using Gmail SMTP in Laravel 5.*

Hi there, hope you are not in trouble with your application email sending feature. I am using mailtrap.io for email testing on the development server. It is good, but one problem is all email are going mailtrap’s Demo inbox, not to users individual email. And my client wants to check all email templates and functionality … Continue reading Send email using Gmail SMTP in Laravel 5.*

Advertisements

Set XSRF(/CSRF) Token Globally or TokenMismatchException in Laravel 5.* (for AJAX)

Very easy (পানির লাহান) 🙂 STEP - 1: First we have to ad a meta tag (name="_token") in header <meta name="_token" content="{{ csrf_token() }}" /> STEP - 2: Then add below jQuery snippet before the </body> tag. Basically here we setting up the csrf token globally for ajax request. And after this we don't need to … Continue reading Set XSRF(/CSRF) Token Globally or TokenMismatchException in Laravel 5.* (for AJAX)

Laravel: php artisan commands

Here I am trying to list all Laravel PHP Artisan commands one by one for my reference and your too.   - To create and update table by migration php artisan make:migration Create_Table_Name  -> create a new table php artisan make:migration Update_Table_Name_Column_Name -> update table php artisan make:migration Add_Column_Name_Table_Name  -> add a new column to a table … Continue reading Laravel: php artisan commands

How to define Global Variable or Constant in Laravel

We often need to define global variables/constants for our application, like Status, Conditions, Countries (we can put all countries in table as it will be along array/object), also weekdays, weekends and e.t.c. vary on projects. Status (Active, Inactive) and Conditions (Ok, Good, Better, Best) or Grade (F, C, D, A, A-, A+), so like these … Continue reading How to define Global Variable or Constant in Laravel

How to print query or debug queries in Laravel

We often need to debug large queries in Laravel. And laravel have built-in functions almost for everything. Here is a simple query in laravel for example. $data = User::where(‘status’, 1) ->select(‘name’, ‘username’, ‘email’, ‘password’) ->get();   but we want to see the sql query. So we have to use toSql() in the place of get() … Continue reading How to print query or debug queries in Laravel

Laravel 5.1: Unsupported operand types (FatalErrorException in …)

Ok. When I am upgrading my application from Laravel 5.0 to 5.1 I get an falat error that this showing "Unsupported operand types"   What did I do on Laravel 5.0: I add two array with in + operator, and that is the problem. So, I looking for solution and get this on Laracast $item_list … Continue reading Laravel 5.1: Unsupported operand types (FatalErrorException in …)