title: can't save new data, and Array to string conversion?
body: <p><img src="https://i.stack.imgur.com/K6B8F.png" alt="enter image description here"></p>
  
  <h2>Model in laravel</h2>
  
  <blockquote>
    <p>"Array to string conversion (SQL: update <code>spent_times</code> set <code>updated_at</code> = 2018-10-18 06:02:29, <code>spent_time</code> = 12, <code>percentage</code> = 60.00, <code>task_category</code> = testing where <code>id</code> = 7) ◀"</p>
  </blockquote>
  
  <pre><code>public static function findOrCreate($plan_id, $data)
  {
      $fromDate = Carbon::now()-&gt;subDay()-&gt;startOfWeek()-&gt;toDateString();
      $nowDate = Carbon::now()-&gt;today()-&gt;toDateString();
  
      $spent_time = static::where('plan_id', $plan_id)-&gt;first();
  
      if (is_null($spent_time)) {
          return static::create($data);
      }else{
          $new_spent_time = SpentTime::find($plan_id);
          $task_category = $new_spent_time-&gt;task_category;
  
          $new_spent_time-&gt;task_category = (['{task_category}' =&gt; $task_category, 
                                          '{daily_spent_time}' =&gt; $new_spent_time-&gt;daily_spent_time,
                                          '{daily_percentage}' =&gt; $new_spent_time-&gt;daily_percentage,
                                          '{spent_time}' =&gt; $new_spent_time-&gt;spent_time,
                                          '{percentage}' =&gt; $new_spent_time-&gt;percentage]);
  
  
          $new_spent_time-&gt;spent_time = $new_spent_time::where('task_category', $task_category)-&gt;sum('daily_spent_time', $new_spent_time-&gt;daily_spent_time, $fromDate);
          $request['spent_time'] = (int)$new_spent_time-&gt;spent_time + $spent_time-&gt;daily_spent_time;
  
          $new_spent_time-&gt;percentage = SpentTime::where('task_category', $spent_time-&gt;task_category)-&gt;sum('daily_percentage', $new_spent_time-&gt;daily_percentage, $fromDate);
          $request['percentage'] = (int)$new_spent_time-&gt;percentage  + $spent_time-&gt;daily_percentage;
          $new_spent_time-&gt;save();
          return $spent_time-&gt;update($data);
      }
  }
  </code></pre>
  
  <h2>Controller in laravel</h2>
  
  <p>in function store, can't save data and can't calculation data by category when create new data, data should be calculated and entered into the table as pict. 
  <img src="https://i.stack.imgur.com/s9sBc.jpg" alt="enter image description here"></p>
  
  <pre><code>public function store(Request $request)
  {      
      $spent_time = SpentTime::findOrCreate($request-&gt;get('plan_id'), [
          'plan_id' =&gt; $request-&gt;get ('plan_id'),
          'daily_spent_time' =&gt; $request-&gt;get ('daily_spent_time'),
          'daily_percentage' =&gt; $request-&gt;get ('daily_percentage'),
          'reason' =&gt; $request-&gt;get ('reason')
      ]);
  
      return redirect()-&gt;route('real.index', compact( 'spent_time'));
  }
  </code></pre>