Laravel Popular Post


Laravel 5 select with count query with group by example

We always required to get count of number of records or number of inserted record of current month etc in laravel. We can use mysql count function in laravel eloquent. We have two way to get count of column value. first we can use laravel count() of query builder and another one we can use with directly with select statement using DB::raw(). I give you both example you can see and use any one as perfect for you. <strong>Example 1:</strong> <pre class="prettyprint lang-php"> $data = DB::table("click")->count(); print_r($data); </pre> <strong>Example 2:</strong> <pre class="prettyprint lang-php.....

By Hardik Savani | June 9, 2016 | | 3273 Viewer | Category : Laravel
READ MORE

Laravel 5 - How to create custom error page with example

If you think how can i create custom error page like 403, 404, 405, 408, 500, 502, 504 on my laravel application then you can make easily and implement it very easily. You can set custom error page globally in laravel project. if you want to create 404 your custom design error page then you can do it easily. <img width="100%" src="/upload/laravel-5-Custom-Error-Page.png" style="border:2px solid red"> In this post i am going to show you how to create custom layout for error page, if you think i want to display 404 page layout difference, 505 error page layout difference, 500 error page layout.....

By Hardik Savani | May 12, 2016 | | 3211 Viewer | Category : Laravel
READ MORE

How to define Global Variables in Laravel 5?

Laravel framework is awesome framework in todays. Laravel provide sevaral good feature and that's why it is very popular framework in PHP. Basically if we are work on big website project or ERP level project we always need to define some global variable like site title, number of pagination, footer text etc as depend on our project. So, I am going to show you how to define and use global variable in Laravel 5. Laravel 5 provide very simple way to set Global Variables in our laravel application. It is very pretty simple and with good directory structure. First we have to create global.php file.....

By Hardik Savani | April 17, 2016 | | 3208 Viewer | Category : Laravel
READ MORE

How to create custom helper in Laravel 5?

I would like to explain how to create custom helper functions, in your laravel project some functions and some repeating code, so at that time you have to create some helper functions that can help to easy way and every time you not need to write more code and very flexible, that way you can easily modify that code. Now if you want to add custom helper functions in your website or project directoty then you have to follow just three step and use it. <strong>Step 1: Create helpers.php File</strong> In this step, you need to create <strong style="color:red">app/Http/helpers.php</strong> in you.....

By Hardik Savani | February 9, 2016 | | 3199 Viewer | Category : Laravel
READ MORE

Laravel 5 - How to prevent browser back button after user logout?

Today, I am going to share with you How to prevent back button after logout in PHP Laravel framework. If you observe deeply then you found this fault, When user logout after if user hitting back button from browser then it will goes on home page or existing page that he was before login. But it should redirect on Login page instead of homepage or other existing page. But we can prevent this issue by using Laravel middleware. We will create one middleware and prevent back button history. So we have to create new middleware and use that middleware in our route. So, I am going to do from scratc.....

By Hardik Savani | October 21, 2016 | | 3133 Viewer | Category : Laravel
READ MORE

How to implement infinite ajax scroll pagination in Laravel 5?

We always want to see auto load more data on page scroll on your home page or other pages for posts, news, listing etc like on facebook, twitter, linkedin etc. If you implemented infinite scroll on your php application then you don't require to give pagination and also not require to page refresh every time when page scroll. So, Today, i going to give you simple example of infinite scroll using jquery ajax on page scroll in laravel application from scratch. I use jquery scroll event for page scroll. this example is pretty simple, you can customize simply for your development. You have to jus.....

By Hardik Savani | August 23, 2016 | | 3030 Viewer | Category : Laravel
READ MORE

Laravel after login, redirect back to previous url ?

If you are working on laravel and you want to do like: How to redirect back to previous url, After login. after login user you can redirect his previous page as he was before. you can do this, i would like to give you two example. first example is using intended() and second one is using session but i don't know more but i think intended() is not working proper in laravel 5 but you can try in laravel 4. but i am sure i gave you example with session that work well in both. So, you can try any one and get your solution, 1. using intended() and 2. session. <strong>Example 1:</strong> <pre class.....

By Hardik Savani | January 15, 2016 | | 3010 Viewer | Category : Laravel
READ MORE

How to get Query Strings Value in Laravel 5?

If you want to get Query string value then you can get using Request Facade OR Input Facade in larave 5. But if you was working native PHP then we can get $_GET method. In following example you can easily get parameter value. <strong class="example">URL Example:</strong> <pre>http://text.com/wall?id=23&name=hdtopi</pre> In above query string, you want to get query string value for example id and name. you can get through bellow example. <strong class="example">Route Example:</strong> <pre>Route::get('wall', 'WallController@wall');</pre> <strong class="example">Controller Example:</strong> <pr.....

By Hardik Savani | March 29, 2016 | | 2899 Viewer | Category : Laravel
READ MORE

Laravel 5 - inner join with multiple conditions example using Query Builder

In this post you can learn how to add multiple condition in join query of Laravel Eloquent. if you use data relationship then you don't need to use but if you need to get manually join with two or more condition then it can help. in this example i also add how to add simple inner join in laravel and how to add multiple conditions with inner join i mean using "on" method. You can see bellow example: <strong>Example:</strong> <pre class="prettyprint lang-php"> $user = User::select("users.*","items.id as itemId","jobs.id as jobId") ->join("items","items.user_id","=","users.id") .....

By Hardik Savani | April 30, 2016 | | 2898 Viewer | Category : Laravel
READ MORE

Laravel 5 - GEO chart example and demo using lavacharts package

Today, i going to give you example of how to add geochart in your laravel 5 application using lavacharts package. Normally we used geochart on back-end for check users country wise with graphical way. In this post we will implement geo chart with country and it's total users. lavacharts advantage is you can manage all data with chart matadata from controller, you just render on view. lavacharts provide several other charts like bar chart, Area chart, Column Chart, Pie Chart, Line Chart etc. In this post we will use geo chart with good graphical way. you can use in your laravel application, y.....

By Hardik Savani | July 19, 2016 | | 2897 Viewer | Category : Laravel
READ MORE


    Laravel 5 - How to prevent browser back button after user logout?

    Laravel 5 - How to prevent browser back button after user logout?

    Open Post

    Laravel 5 - Authenticate user in NodeJS with socket io using JWT.

    Laravel 5 - Authenticate user in NodeJS with socket io using JWT.

    Open Post

    How to get location information from ip address in Laravel ?

    How to get location information from ip address in Laravel ?

    Open Post

    PHP - jquery ajax crop image before upload using croppie plugin

    PHP - jquery ajax crop image before upload using croppie plugin

    Open Post

    Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin

    Twitter Bootstrap - Digital Clock picker with AM PM example using clockface plugin

    Open Post

    PHP - How to implement Google new reCAPTCHA Code Example with Demo?

    PHP - How to implement Google new reCAPTCHA Code Example with Demo?

    Open Post