Latest Laravel Post


How to create Event for Mail sending in Laravel 5.2?

Events provides a simple observer implementation, allowing you to subscribe and listen for events in your application. In this posts you can learn how to create event for email send in your laravel 5.2 application. event is very help to create proper progmamming way. First create event using bellow command. <pre class="prettyprint lang-php">php artisan make:event SendMail</pre> Ok, now you can see file in this path <strong class="path">app/Events/SendMail.php</strong> and put bellow code in that file. <strong>app/Events/SendMail.php</strong> <pre class="prettyprint lang-php"> namespace App\Ev.....

By Hardik Savani | March 13, 2016 | | 28053 Viewer | Category : Laravel
READ MORE

Laravel 5.2 chat message module using socket.io, redis, express and nodejs from from scratch.

In this tutorial, i going to show you how to make real time chat message module using socket.io, redis, express and nodejs in Laravel 5. socket.io through we can make real time chat module in our Laravel 5 application. i show you from scratch because you can install nodejs and its packages etc. in this post you can undestand and learn step by istalling and how to write code. You have to follow the step and implement real time chat module in your application. So basically you can see bellow preview of our chat message module. <strong>Preview:</strong> <img width="100%" src="/upload/socketio.png.....

By Hardik Savani | March 12, 2016 | | 89841 Viewer | Category : Laravel
READ MORE

Laravel 5 export to pdf using maatwebsite example

In this post i will show you how to export or download pdf file from database table by maatwebsite. maatwebsite packages throught you can easily generate pdf file. so now i show you simple example of items table data, you can donwload in pdf formate. In following few step you can implement export both function in your project. we have to also need to use dompdf package for pdf generater. let's follow step. <strong class="step">Step 1: Installation</strong> Open your composer.json file and add bellow line in required package. <strong>Laravel 5</strong> <pre>"maatwebsite/excel": "~2.1.0"</pre> <.....

By Hardik Savani | March 9, 2016 | | 34224 Viewer | Category : Laravel
READ MORE

How to use where clause with mysql function in Laravel 5?

When you are working on laravel projects and you need to use mysql function in where clause then you can easily use that using DB::raw() and whereRaw(). In this example you can show how to i use mysql function in where clause. In this example i want to compare with year of created_at field but not whole date, that's whay i use mysql function Year(), this function will return only year from timestamp and compare with given value. I add two example of how to use sql function in where cause. let's See both example. <strong class="example">Example 1:</strong> <pre class="prettyprint lang-sql"> $da.....

By Hardik Savani | March 9, 2016 | | 2607 Viewer | Category : Laravel
READ MORE

How to get latitude longitude from mysql in laravel 5?

Whenever you need to get nearest posts from lat and long and if you are working on laravel query builder. then you can get distance easily using DB::raw(), so you can learn from following example how to get nearest value from mysql laravel. <strong>Example:</strong> <pre class="prettyprint lang-php"> $lat = 1; $lon = 1; DB::table("posts") ->select("posts.id" ,DB::raw("6371 * acos(cos(radians(" . $lat . ")) * cos(radians(posts.lat)) * cos(radians(posts.lon) - radians(" . $lon . ")) + sin(radians(" .$lat. ")) * sin(radians(posts.lat))) AS distance")) ->groupBy("posts.id") ->ge.....

By Hardik Savani | March 8, 2016 | | 4444 Viewer | Category : Laravel
READ MORE

How to add mysql trigger from migrations in Laravel 5?

Sometimes you require to add trigger in your mysql database of laravel 5. but you think how to create trigger using laravel migration because laravel not provide special function like insertTrigger and something so it problem to create direclty, But laravel DB::unprepared() through we can create trigger for database. In Following example you can see how to create migration and create trigger code and how to write drop trigger code, so let's do it this way. <strong class="step">Create Migration:</strong> <pre>php artisan make:migration add_trigger</pre> <strong class="step">Migration:</stron.....

By Hardik Savani | March 8, 2016 | | 7583 Viewer | Category : Laravel
READ MORE

How to confige Elasticsearch in our local system

In this tutorials we have learn how to configer a Elastic search in our local system. follow this step and easily configer an Elastic Search. <strong class="step">1) Step 1 — Installing Java :</strong> -Before installing OpenJDK with APT, update the list of available packages for installation on your Ubuntu Droplet by running the command: <pre class="prettyprint lang-php prettyprinted"> <span style="color:#FFFFFF;font-weight:900;">$ sudo apt-get update</span> </pre> -After that, you can install OpenJDK with the command: <pre class="prettyprint lang-php prettyprinted"> <span style="color:#.....

By Hardik Savani | March 7, 2016 | | 3508 Viewer | Category : Laravel
READ MORE

Laravel 5 query builder where exists example

you use sql where exists clause in laravel. whereExists through you can use sql where exists clause in your laravel project. It is very easy to use and you can easily undestand. You can give SELECT statment in where condition. you can see bellow example and you can learn how to use whereExists in your app. <strong>SQL Query</strong> <pre class="prettyprint lang-sql"> SELECT * FROM `items` WHERE EXISTS (SELECT `items_city`.`id` FROM `items_city` WHERE items_city.item_id = items.id) </pre> <strong>Using Laravel Query Builder</strong> <pre class="prettyprint lang-php"> DB::table('it.....

By Hardik Savani | March 7, 2016 | | 4215 Viewer | Category : Laravel
READ MORE

How to resolve laravel 5 blank page on server?

When i was created my laravel 5.2 application and i upload application on live GoDaddy server. But i found blank page. I think First you have to check php version on live server. if you run laravel 5+ application then make sure your PHP version at least <strong class="path">PHP 5.5</strong>. But, again i don't know why it was blank page and i checked permission of storage folder 777. so basically when you found blank page on your shared hosting the first make sure permission on <strong class="path">storage Directory 777 Permission</strong>. But if you can't solve and found again then also ch.....

By Hardik Savani | March 6, 2016 | | 4298 Viewer | Category : Laravel
READ MORE

How to use DB transactions in laravel 5?

First, Let's undestand why we are use transactions in laravel project. But db transactions is very important concept and very usefull because it securely manage. laravel 5 also provide to transactions commit, rollback etc functions. How to use transactions in my project, so I an going to give you one example, I have a three table "items", "items_city" and "items_count" and i need to add new row same time and "items" table is a main table then "items_city" and "items_count" is a child table of "items" table. so bassically why we nee to use transactions because if when i was add new records in d.....

By Hardik Savani | March 6, 2016 | | 2637 Viewer | Category : Laravel
READ MORE

    Laravel 5 Ajax CRUD with Pagination example and demo from scratch

    Laravel 5 Ajax CRUD with Pagination example and demo from scratch

    Open Post

    How to get filename from file path in MySQL?

    How to get filename from file path in MySQL?

    Open Post

    Laravel 5 Google OAuth authentication using Socialite Package

    Laravel 5 Google OAuth authentication using Socialite Package

    Open Post

    Laravel 5 client side validation using Parsley.js example

    Laravel 5 client side validation using Parsley.js example

    Open Post

    Magento 2 - How to solve one or more indexers are invalid by command line?

    Magento 2 - How to solve one or more indexers are invalid by command line?

    Open Post

    Laravel 5 - Simple user access control using Middleware

    Laravel 5 - Simple user access control using Middleware

    Open Post