title: Adding seconds with Carbon
body: <p>The idea is that I need to get end_date from the Auction via this model, which is inside a database, in MySQL timestamp format (I use phpmyadmin, if it matters, ex. 2018-11-14 04:58:07). So when I get the end_date, the idea is to increment it by few seconds (ex. 10 seconds) via Carbon addSeconds() function and then write it again into the DB. Here is the controller where it's done and my Auction model.
  What happens is that i get the FatalThrowableError 'Call to a member function addSeconds() on integer'. I played around quite a lot and can't seem to find right format for the secs2 variable.</p>
  
  <p>Auction.php</p>
  
  <pre><code>public $id;
  public $name;
  public $descript;
  public $price;
  public $pic;
  public $end_date;
  public $offers;
  public $offered_by;
  
      public function get(){
      $result =
          DB::table('auctions')
              -&gt;select('*')
              -&gt;where('id', '=', $this-&gt;id)
              -&gt;first();
      return $result;
  }
  
      public function increment($id){
      $result =
          DB::table('auctions')
              -&gt;where('id', $id)
              -&gt;update([
                  'offers' =&gt; DB::raw('offers + 1'),
                  'end_date' =&gt; $this-&gt;end_date
              ]);
      return $result;
  }
  </code></pre>
  
  <p>AuctionController.php</p>
  
  <pre><code>    public function offer($id, Request $request){
      $auction = new Auction();
      $auction-&gt;id = $id;
  
      $secs = $auction-&gt;get()-&gt;end_date;
      $secs2 = strtotime($secs);
      $secs2-&gt;addSeconds(120);
  
      $auction-&gt;end_date = $secs2;
      //dd($secs2);
  
      $auction-&gt;increment($id);
  }
  </code></pre>