Save multiple data in database column from select multiple

  eloquent, laravel

I want to save more than one university under one student. For html select I used

<select class="selectpicker" multiple data-live-search="true" name="university">
  @foreach($districts as $row)
     <option value= {{$row->name}} > {{$row->name}} </option>

This taking previously saved university. I am using district as university.


public function store(Request $request)
            'name' => $request['name'],
            'email' => $request['email'],
            'passport' => $request['passport'],
            'phone_number' => $request['phone_number'],
            'address' => $request['address'],
            'dateofbirth' => $request['dateofbirth'],
            'ielts' => $request['ielts'],
            'openingcharge' => $request['openingcharge'],
            'serviceCharge' => $request['serviceCharge'],
            'applydate' => $request['applydate'],
            'visaStatus'=> $request['visaStatus'],
            'country' => $request['country'],
            'university'=> $request['university'],
        return back();

This is saving the students. This is a mishmash code I am sorry about that. I am working on a different for fast learning. Here I am using seller_info as student.

The data is is saving university but only one university in the database. I tried to use for loop in case of storing. But could not able to implement it properly.

My table file->

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


And model

protected $fillable = [
        'name', 'email', 'passport', 'phone_number','address','dateofbirth','ielts', 'openingcharge','serviceCharge','applydate',


Source: Laravel

Leave a Reply