title: Laravel error : Array to string conversion
body: <p>i want to select and store multiple data from my form the input name is &quot;property_type&quot;, but i get that error 'Array to string conversion ' :
  this is my migration :</p>
  <pre><code> public function up() {
      Schema::create('projects', function (Blueprint $table) {
          $table-&gt;bigIncrements('id');
          $table-&gt;string('ref')-&gt;nullable();
          $table-&gt;string('name');
          $table-&gt;string('community');
          $table-&gt;text('property_type')-&gt;nullable();
          $table-&gt;integer('floor_number')-&gt;nullable();
          
      });
  }
  </code></pre>
  <p>my model :</p>
  <pre><code>class Project extends Model implements HasMedia {
   protected $fillable = [
      'ref',
      'name',
      'community',
     'property_type',
      'floor_number',
     
  ];
  
    public function setPtypeAttribute($value) {
      $this-&gt;attributes['property_type'] = json_encode($value);
  }
  
  /**
   * Get the categories
   *
   */
  public function getPtypeAttribute($value) {
      return $this-&gt;attributes['property_type'] = json_decode($value);
  }
  </code></pre>
  <p>the view :</p>
  <pre><code>&lt;form enctype=&quot;multipart/form-data&quot; method=&quot;POST&quot; novalidate action=&quot;{{ route(&quot;admin.projects.store&quot;) }}&quot; &gt;
          @csrf
       
       
      &lt;div class=&quot;form-group&quot;&gt;
              &lt;label class=&quot;required&quot;&gt;property_type&lt;/label&gt;
              &lt;select class=&quot;form-control  select2 name=&quot;property_type[]&quot; id=&quot;property_type&quot; required multiple=&quot;&quot;&gt;
                  &lt;option value=&quot;php&quot;&gt;PHP&lt;/option&gt;
                  &lt;option value=&quot;react&quot;&gt;React&lt;/option&gt;
                  &lt;option value=&quot;jquery&quot;&gt;JQuery&lt;/option&gt;
                  &lt;option value=&quot;javascript&quot;&gt;Javascript&lt;/option&gt;
                  &lt;option value=&quot;angular&quot;&gt;Angular&lt;/option&gt;
                  &lt;option value=&quot;vue&quot;&gt;Vue&lt;/option&gt;
              &lt;/select&gt;
             
          &lt;/div&gt;
  </code></pre>
  <p>my storeprojectrequest :</p>
  <pre><code>'property_type' =&gt; [
              'array',
              'nullable',
          ],
  </code></pre>
  <p>i need help !</p>