Categories
makitweb.com

Import CSV Data to MySQL Database with Laravel

In CSV file you can store data in comma-separated string format.

Sometimes require to import existing CSV file data to MySQL database.

For this, you can either directly read the file or upload and then read the file for insert data.

In this tutorial, I show how you can upload and import CSV file data in your MySQL database with Laravel.

Import CSV Data to MySQL database with Laravel

Categories
makitweb.com

Change Selected option in Select2 Dropdown with jQuery

Select2 is a jQuery plugin which customizes HTML select element and makes it more user-friendly.

It adds search features, allows to add an image with options.

The HTML select element option can easily set selected using jQuery – $(selector).val(option-value);.

But this not directly work with the Select2 dropdown element.

In this tutorial, I show how you can dynamically set an option selected in Select2 with jQuery.

Change Selected option in Select2 Dropdown with jQuery

Categories
makitweb.com

How to Upload a File in Laravel

File uploading is most used functionality in web applications.

Lots of application allows the users to manipulate files to the server like – profile image, upload documents, import data, etc.

In this tutorial, I show how you can validate and upload a file in Laravel.

How to Upload a File in Laravel