Latest Laravel Post


How to disable model timestamps in Laravel 5.3?

Sometimes we require to disable created_at and updated_at timestamps on Model on Laravel, so we can do it simply by using <strong class="path">$timestamps</strong> variable of model. It is very small things but important to understand and how to use it. When you create new item or user using model at that time created_at and updated_at column set default time by default but you can prevent to set false value of $timestamps variable. I am creating new records using create method of model like as bellow example: <pre class="prettyprint lang-php"> Item::create(['title'=>'ItSolutionStuff.com']).....

By Hardik Savani | October 12, 2016 | | 3616 Viewer | Category : Laravel
READ MORE

Laravel 5.3 - Customize pagination templates example from scratch

Today, I am going to tell you how to building and apply new custom paginator view in Laravel 5.3. Laravel 5.3 added new features and update for easily implement your own manual pagination blade template. By Default Laravel 5.3 provide us very simple bootstrap pagination view. But if you are not using bootstrap and you want to change then you can simply change OR if you want to add new bootstrap pagination layout then you can do it. In bellow example you can see how to create custom blade layout and use them. This example from scratch so you can simply implement it in your project or laravel .....

By Hardik Savani | October 9, 2016 | | 15707 Viewer | Category : Laravel
READ MORE

Laravel 5.3 new feature and update - $loop variable

Laravel 5.3 provides several new features in API, Mail, Model, Blade Template etc. Today we learn new feature <strong class="path">$loop</strong> variable of blade view in Laravel 5.3. Laravel Blade templating language provides several things like @if, @foreach, @include etc and you know this thing very well. Laravel 5.3 give new variable $loop in blade template engine and you can use it with <strong>@foreach</strong>. $loop variable through we can simply get first and last records. Sometimes we require to give difference layout of first element and last element of loop. So, you can simply d.....

By Hardik Savani | October 6, 2016 | | 3433 Viewer | Category : Laravel
READ MORE

Laravel 5 - Multiple markers in google map using gmaps.js

Today, we learn how to implement google map with multiple marker using gmaps.js library in Laravel 5. We can also simply use google map API for maps, But gmaps.js is very popular and they provides very simple way to generate google map. gmaps.js through we can make multiple markers, make routes, Geocoding, Map events etc. In this example i use multiple markers example. If you are beginner then also you can do it simply following post, i did this example from scratch. So, After finish all tutorial you will find layout as bellow: <strong>Preview:</strong> <img src="/upload/laravel-5-gmaps.png.....

By Hardik Savani | September 30, 2016 | | 20019 Viewer | Category : Laravel
READ MORE

How to check uploaded file is empty or not in Laravel 5.3?

Today, in this post we will learn how to check uploaded file is present or not on request object. If you work on file uploading or image uploading then you have to require to check file array is empty or not. Laravel 5.3 provide two way to check file is present or not in request object. In bellow example you can see how to check. It is very simple example that way you can simply understand. <strong>Example 1:</strong> <pre class="prettyprint lang-php"> public function fileUpload(Request $request) { if ($request->hasFile('image')) { dd('write code here'); } } </pre> <strong>Example 2.....

By Hardik Savani | September 28, 2016 | | 3330 Viewer | Category : Laravel
READ MORE

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

Today, i am going to show you how to authenticate user node js using JWT and socket io in Laravel 5.3. It is very very important because if you are working with chat application or messengers system etc with user then you have to use JWT token because it is very safe and secure way. If we work on chat module with socket io but someone can easily hack our code. At that time we require to check given JWT token is valid or not using <strong class="path">socketio-jwt</strong> package of Node. socketio-jwt package thorough we can simply authentication with user and identify that token is valid .....

By Hardik Savani | September 25, 2016 | | 13310 Viewer | Category : Laravel
READ MORE

Laravel 5.3 - Call to undefined method Illuminate\Database\Query\Builder::lists() Solved

Today i want to tell you about error "Call to undefined method Illuminate\Database\Query\Builder::lists()" and how to solve this error in Laravel 5.3. When i was working on my Laravel 5.3 application, at that time i require to get lists of email and id of users table for select drop-down. But when i use lists() with DB table i found error "Call to undefined method Illuminate\Database\Query\Builder::lists()". Error was like bellow preview: <pre> BadMethodCallException in Builder.php line 2440: Call to undefined method <br/> Illuminate\Database\Query\Builder::lists() </pre> I did search a lo.....

By Hardik Savani | September 24, 2016 | | 6215 Viewer | Category : Laravel
READ MORE

Laravel 5.3 - image dimension validation rules example

Laravel 5 provide new image dimensions validation option for image upload. In this validation rules we can set several rules like as listed bellow: <strong class="step">Dimensions Rules:</strong> <strong>1)width</strong> <strong>2)height</strong> <strong>3)min_width</strong> <strong>4)min_height</strong> <strong>5)max_width</strong> <strong>6)max_height</strong> <strong>7)ratio</strong> In this Dimensions option through we can set fix width and height, if invalid width and height of image then it will return error. Same way we can set validation min and max height width on your validation. F.....

By Hardik Savani | September 24, 2016 | | 4401 Viewer | Category : Laravel
READ MORE

Response download with file in Laravel 5.3 example

We sometimes require to return response with download file from controller method like generate invoice and give to download or etc. Laravel 5 provide us response() with download method that way we can do it. In First argument of download() we have to give path of download file. We can rename of download file by passing second argument of download(). We can also set headers of file by passing third argument. In bellow example will help you how it is works. So, first i am going to create new route for our example as like bellow: <strong>routes/web.php</strong> <pre class="prettyprint lang-ph.....

By Hardik Savani | September 21, 2016 | | 13859 Viewer | Category : Laravel
READ MORE

Laravel 5.3 - import export csv and excel file into database

Laravel 5.3 release few days ago and they upgrade several feature on Laravel 5.3. They also some changes on directory structure and etc. So, Today I am going to give you one example how to import and export xls, xlsx and csv files. I also added post for Laravel 5, but this example will help you to implement on your Laravel 5.3 application. In this example through you can import excel or csv to store in database and export or download excel or csv file from database table. For this example i use maatwebsite package from scratch. Maatwebsite package though we can easily working with csv and .....

By Hardik Savani | September 18, 2016 | | 75024 Viewer | Category : Laravel
READ MORE

    Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin

    Jquery - Display a loading gif image before a image loads using Eager ImageLoader plugin

    Open Post

    Laravel 5 database backup using Laravel Backup Package

    Laravel 5 database backup using Laravel Backup Package

    Open Post

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

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

    Open Post

    How to get gravatar image from email using Jquery?

    How to get gravatar image from email using Jquery?

    Open Post

    Laravel 5 - Google reCaptcha code and Validation example using anhskohbo/no-captcha package

    Laravel 5 - Google reCaptcha code and Validation example using anhskohbo/no-captcha package

    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