title: Set Cron Job According to created_at And Hours given by admin in another column same table
body: <p>I want to set a cron job that automatically reject those bookings who are not accepted within given time by admin.</p>
  <p>The cron job function code is</p>
  <pre><code>public function cronJob()
  {
      $time = DB::table('timer')-&gt;orderBy('created_at','desc')-&gt;first();
      $book = Booking::where('created_at', '&lt;=', Carbon::now()-&gt;subHours($time-&gt;hours))-&gt;where('accepted','=',0)-&gt;get();
      foreach($book as $row)
      {
          if($row-&gt;accepted != 1)
          {
              Booking::where('id',$row-&gt;id)-&gt;update(['rejected' =&gt; 1, 'accepted' =&gt; 0,'status' =&gt; 'Cancelled']);
          }
      }
      return response()-&gt;json([
          'status' =&gt; true,
          'message' =&gt; 'Executed',
          'data' =&gt; []
      ], 201);
  }
  </code></pre>
  <p>Currenlty i'm Using another table but i need to set time for each booking</p>