Category : Laravel


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 | | 3258 Viewer | Category : Laravel
READ MORE

How to get file size from URL in Laravel 5?

We sometimes require to get file size from path in laravel, so if you need to get file size from url then no worry and you can get using File facade. File facade provide several function that way we can get size of file or image. In bellow example i just give you path of my images folder inside public folder and one image, that give path as argument of size function: <strong>Example:</strong> <pre class="prettyprint lang-php"> {{ File::size(public_path('images/1461177230.jpg')) }} </pre>

By Hardik Savani | July 18, 2016 | | 1037 Viewer | Category : Laravel
READ MORE

Laravel 5 - generate PDF from html view file and download using dompdf

Normally, if we work on big ERP level project on laravel, we require to generate PDF file for data from database table. In this tutorial i give you very simple way to create pdf file and give to download that pdf step by step for beginners. In this post i use laravel-dompdf package for create pdf file and this package also provide to download function. In this example i have a one table "items" and i will download pdf file of items table data with tabular format, You can also write your own css on view file for pdf, so you can make batter pdf file. So, finally you have to just follow few ste.....

By Hardik Savani | July 15, 2016 | | 13467 Viewer | Category : Laravel
READ MORE

How to get last record of database table in Laravel?

Sometimes we may require to get only last record of table in our project, we can get several way. We can fetch last record of database table using latest() or orderBy(). In bellow example you can see how i get then last record of table. I have "items" table and i want to get last record of "items" table. In first example i use latest() with first() because latest() will fetch only latest record according to created_at then first() will get only single record: <strong>Using latest() belong to created_at field:</strong> <pre class="prettyprint lang-php"> $last = DB::table('items')->latest()->f.....

By Hardik Savani | July 14, 2016 | | 1535 Viewer | Category : Laravel
READ MORE

Laravel 5 - How to convert file(image, audio, video) extension using CloudConvert?

We may sometimes require to convert file extension like if you have video type mov or flv or 3gp etc and you should have to convert it into mp4, OR if you have image type png, jpeg, gif and require to convert it into jpj, Same as for audio mp3, then all the thing you can do using CloudConvert API. you can also convert pdf into jpg using CloudConvert API. In this example i use CloudConvert API with Laravel. CloudConvert is a very popular API for convert file extensions. So in this example i used CloudConvert API for any video extension convert into mp4. you can also convert anything as you wan.....

By Hardik Savani | July 13, 2016 | | 3111 Viewer | Category : Laravel
READ MORE

How to add git add remote origin on bitbucket repository ?

when i was working on my laravel project with my friend. both are working on same project, when i changed on many files, he don't know and he changed name of repository on bitbucket and i couldn't push any thing, i told him. He know how can we resolve this issue so i remove my old remote and added new remote url on my existing repository. Finally, i solved my issue, if you also fetch issue like i had then you can just follow bellow command and solve. <strong>Terminal Command</strong> <pre class="prettyprint lang-php"> git remote -v git remote remove origin git remote add origin Bitbucket_Rep.....

By Hardik Savani | July 12, 2016 | | 438 Viewer | Category : Laravel
READ MORE

Laravel tokenmismatchexception in verifycsrftoken.php - Solved

When i had started to learn laravel, i found error - tokenmismatchexception in verifycsrftoken.php when submit form POST method. I was new i can't understand what is the error. but i read docs and search google i found that i need to add laravel csrf_token as hidden parameter. csrf_token() is for security reason, Laravel use Middleware VerifyCsrfToken to check csrf token is valid or not, so you have to just add bellow line in your form: <pre> <input type="hidden" name="_token" value="{{{ csrf_token() }}}" /> </pre>

By Hardik Savani | July 10, 2016 | | 1064 Viewer | Category : Laravel
READ MORE

Laravel 5 Autocomplete using Bootstrap Typeahead JS Example with Demo

Autocomplete is must if you are dealing with big data table, like you have products table and thousands of records so it's not possible to give drop-down box, but it is better if we use Autocomplete instead of select box. In this example i use Bootstrap Typeahead JS plugin for auto-complete, Typeahead.js plugin provide good layout using bootstrap so it pretty good. You can implement autocomlete in your laravel application just following few step. After this example finish you will find out layout as bellow: <strong>Preview:</strong> <img src="/upload/laravel-autocomplete.png" style="width:10.....

By Hardik Savani | July 9, 2016 | | 10131 Viewer | Category : Laravel
READ MORE

How to set global view variables using composer share in Laravel 5?

Everyone will have same situation sometimes, like we have some information that we need to access in all view files for example site title, login user information, footer information etc. But, we can define global view variables using composer() of Laravel. We just have to define value in AppServiceProvider and we can access that variable in every blade files. In bellow example i set "siteTitle" variable as global and i can access that variable in every view files. You have to just open <strong class="path">AppServiceProvider.php</strong> and we can set variable as like bellow: <strong>app/.....

By Hardik Savani | July 8, 2016 | | 981 Viewer | Category : Laravel
READ MORE

How to remove key from array in Laravel 5?

Sometimes, we require to delete specific key from array like we have password and confirm-password field but we don't require to store confirm-password field we have to drop that key from input array, At that time we always use unset() function of PHP pre-define. But if you work on laravel then you can array helper function. we can remove multiple key from variable using <strong class="path">array_except()</strong> of Laravel pre-define function. In bellow example you can understand very well. <strong>Example:</strong> <pre class="prettyprint lang-php"> $myArray = ['name'=>'HD','email'=>'te.....

By Hardik Savani | July 7, 2016 | | 1165 Viewer | Category : Laravel
READ MORE

    How to send mail using mailable in laravel 5.3?

    How to send mail using mailable in laravel 5.3?

    Open Post

    How to create custom helper in Laravel 5?

    How to create custom helper in Laravel 5?

    Open Post

    PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo

    PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo

    Open Post

    Jquery email autocomplete example with demo using jquery.email-autocomplete.min.js

    Jquery email autocomplete example with demo using jquery.email-autocomplete.min.js

    Open Post

    How to add multiple markers in google map

    How to add multiple markers in google map

    Open Post

    Laravel 5 - How to get difference of time in minutes?

    Laravel 5 - How to get difference of time in minutes?

    Open Post