Posts

Showing posts from November, 2017

Laravel 5 Chart example using Charts Package

Image
It's always a good fit for understanding if we use some graphical way display our progress report using the chart. So if you are working with laravel 5 framework then you can use chart very simple way and best layout. There are several js libraries available for a chart like chartjs, highcharts, google, material, chartist, fusioncharts, Morris, plottablejs etc. in this example we will just use one laravel "ConsoleTVs/Charts" composer package and you can use all the chart library. Using above library you can simply create following Charts. 1. line chart 2. area chart 3. bar chart 4. pie chart 5. donut chart 6. geo chart 7. gauge chart 8. temp chart 9. percentage chart 10. progress bar chart 11. areaspline chart 12. scatter chart Using ConsoleTVs/Charts package we can simply create above lists on the chart. We don't require to write jquery code for the chart we can manage it from a controller method. So here I give you a very easy example o

How to send email using gmail in PHP Laravel 5?

Image
Laravel is a very popular framework for PHP in today's. Laravel is famous because they provide several goods things like MVC, routing, mail etc. In this article, we will learn how to send email using SMTP driver. Laravel 5 provide several drivers options like SMTP, Mail, SendMail, and services supported include Mailgun, Sendgrid, Mandrill, Amazon SES, etc. So, here i will let you know how to send email from your Gmail account using SMTP driver. Laravel provides the configuration file for email. you can see that file here: config/mail.php, you can also make the change manually but laravel is smart so they provide .env file for configuration as like below: .env MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=addYourEmail MAIL_PASSWORD=AddYourEmailPassword MAIL_ENCRYPTION=tls You can simply configuration here as above env variable. now I am going to provide a simple example to add a new route to your route file as like bellow added. ro

Laravel Stats Tracker

Image
Why? Storing user tracking information, on indexed and normalized database tables, wastes less disk space and ease the extract of valuable information about your application and business. Usage As soon as you install and enable it, Tracker will start storing all information you tell it to, then you can in your application use the Tracker Facade to access everything. Here are some of the methods and relatioships available: How you write your won method : <?php class Tracker Extends Eloquent {     public $attributes = ['hits' => 0];     protected $fillable = ['ip', 'date'];     public $timestamps = false;     protected $table = 'visitor';     public static function boot() {         // When a new instance of this model is created...         static::creating(function ($tracker) {             $tracker->hits = 0;         } );         // Any time the instance is saved (create OR update)