argument('type'); if (! class_exists($class)) abort(500,sprintf('No class [%s]',$this->argument('type'))); foreach ($class::where('filename','LIKE','%INCOMING%')->get() as $o) { // Catch any files that are already there. if ($o->moveable() === 1) { $o->duplicate = TRUE; $o->save(); continue; } $x = NULL; if (! $o->scanned OR $o->duplicate OR $o->remove OR ($x=$o->moveable()) !== TRUE) { $this->warn(sprintf('Ignoring (%s)[%s]... [%s]',$o->id,$o->file_path(),$x)); continue; } switch (strtolower($this->argument('type'))) { case 'photo': $this->dispatch((new PhotoMove($o))->onQueue('move')); break; case 'video': $this->dispatch((new VideoMove($o))->onQueue('move')); break; default: $this->error('Dont know how to handle: ',$this->argument('type')); } } } }