You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
956 B

  1. <?php
  2. namespace App\Console\Commands;
  3. use Illuminate\Console\Command;
  4. use Laravel\Lumen\Routing\DispatchesJobs;
  5. use App\Jobs\TripComplete;
  6. use DB;
  7. class TestTrip extends Command {
  8. use DispatchesJobs;
  9. protected $signature = 'test:tripcomplete';
  10. protected $description = 'Queue a TripComplete job';
  11. public function handle() {
  12. $db = DB::table('databases')->where('write_token','=','test')->first();
  13. $loc = json_decode('{"properties":{"end":"2015-12-28T23:20:14Z","start":"2015-12-28T22:45:22Z","mode":"bicycle","distance":6439.4875686883,"end-coordinates":[-122.67617024493,45.549965919969],"start-coordinates":[-122.63860439893,45.522223161576],"duration":2092.7059409618,"type":"trip","timestamp":"2015-12-28T23:20:14Z"},"stopped_automatically":true,"type":"Feature","geometry":{"type":"Point","coordinates":[-122.67617024493,45.549965919969]}}', true);
  14. $this->dispatch((new TripComplete($db->id, $loc))->onQueue('compass'));
  15. }
  16. }