Multiselect Dropdown With Checkbox In Laravel 7/6




Multiselect Dropdown With Checkbox In Laravel 7/6

Hi Guys

This post will give you example of multiselect dropdown with checkbox in laravel . Here you will learn laravel multi select dropdown with checkbox. if you want to see example of multiselect dropdown with checkbox using laravel then you are a right place. This post will give you simple example of multiple select with checkbox example in laravel . You just need to some step to done laravel tutorial for multiselect dropdown with checkbox.

In this blog, I will explain how to multiselect dropdown with checkbox in laravel 7/6.we are going to discuss how to create multiple select dropdown listbox with checkbox select option by using Bootstrap Multiselect plugin. In one of the previous post we have already made discussion on multiple select dropdown list by using Bootstrap plugin, but in that plugin there is no functionality of checkbox option select.If you have use this plugin for make multiple select dropdown list then for select multiple option there is checkbox, so by check checkbox we can select multiple option from dropdown list box.

Here we will seen simple example with this type of multi select dropdown list box. We will insert value of multi select dropdown by using Ajax JQuery with Laravel 6.

Step 1 : Install Laravel 7/6 Application

we are going from scratch, So we require to get fresh Laravel application using bellow command, So open your terminal OR command prompt and run bellow command:

composer create-project --prefer-dist laravel/laravel blog

Database Configuration

In this step, we require to make database configuration, you have to add following details on your .env file.

1.Database Username

1.Database Password

1.Database Name

In .env file also available host and port details, you can configure all details as in your system, So you can put like as bellow:

following path: .env





Step 2: Create frameworks Table and Model

In this step we have to create migration for frameworks table using Laravel 7/6 php artisan command, so first fire bellow command:

php artisan make:model Framework -m

After this command you have to put bellow code in your migration file for create frameworks table.

following path: /database/migrations/2020_01_10_102325_create_frameworks_table.php


use Illuminate\Database\Migrations\Migration;

use Illuminate\Database\Schema\Blueprint;

use Illuminate\Support\Facades\Schema;

class CreateFrameworksTable extends Migration



* Run the migrations.


* @return void


public function up()


Schema::create('frameworks', function (Blueprint $table) {







* Reverse the migrations.


* @return void


public function down()





Now we require to run migration be bellow command:

php artisan migrate

After you have to put bellow code in your model file for create frameworks table

following path:/app/Framework.php


namespace App;

use Illuminate\Database\Eloquent\Model;

class Framework extends Model


protected $fillable = [




Step 3: Create Route

In this is step we need to create route for multiselect dropdown with checkbox layout file



Step 4: Create Controller

here this step now we should create new controller as FrameworkController,So run bellow command for generate new controller

php artisan make:controller FrameworkController

now this step, this controller will manage multiselect dropdown with checkbox layout bellow content in controller file.following fille path

following path:/app/Http/Controllers/FrameworkController.php


namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Framework;

class FrameworkController extends Controller


public function index()


return view('framework');


public function store(Request $request)


$input = $request->all();

$data = [];

$data['name'] = json_encode($input['name']);


return response()->json(['success'=>'Success Fully Insert Recoreds']);



Step 5: Create Blade Files

In Last step, let's create framework.blade.php (resources/views/framework.blade.php) for layout and multiselect dropdown with checkbox and put following code

following path:/resources/views/framework.blade.php

<!DOCTYPE html>



<title>Multiselect Dropdown With Checkbox In Laravel - </title>

<script src=""></script>

<script src=""></script>

<link rel="stylesheet" href="" />

<script src=""></script>

<script src=""></script>

<link rel="stylesheet" href="" />

<meta name="csrf-token" content="{{ csrf_token() }}">


<body class="bg-info">

<br /><br />

<div class="container" style="width:600px;">

<h2 align="center">Multiselect Dropdown With Checkbox In Laravel-</h2>

<br /><br />

<form method="post" id="framework_form">

<div class="form-group">

<label>Select which Framework you have knowledge</label>

<select id="framework" name="name[]" multiple class="form-control" >

<option value="Codeigniter">Codeigniter</option>

<option value="CakePHP">CakePHP</option>

<option value="Laravel">Laravel</option>

<option value="YII">YII</option>

<option value="Zend">Zend</option>

<option value="Symfony">Symfony</option>

<option value="Phalcon">Phalcon</option>

<option value="Slim">Slim</option>



<div class="form-group">

<input type="submit" class="btn btn-info" name="submit" value="Submit" />



<br />






nonSelectedText: 'Select Framework',

enableFiltering: true,

enableCaseInsensitiveFiltering: true,



$('#framework_form').on('submit', function(event){


var form_data = $(this).serialize();


headers: {

'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')




url:"{{ route('') }}",





$('#framework option:selected').each(function(){

$(this).prop('selected', false);










Now we are ready to run our example so run bellow command for quick run:

php artisan serve

Now you can open bellow URL on your browser:


It Will help you...

#Laravel 7


#Laravel 6