Advertisement
Guest User

Untitled

a guest
Nov 9th, 2018
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.04 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Jobs;
  4.  
  5. use Illuminate\Bus\Queueable;
  6. use Illuminate\Queue\SerializesModels;
  7. use Illuminate\Queue\InteractsWithQueue;
  8. use Illuminate\Contracts\Queue\ShouldQueue;
  9. use Illuminate\Foundation\Bus\Dispatchable;
  10.  
  11. class Syncronize implements ShouldQueue
  12. {
  13.     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
  14.    
  15.     /**
  16.      * The number of times the job may be attempted
  17.      * @var int
  18.      */
  19.     public $tries = 1;
  20.  
  21.     /**
  22.      * the file to process
  23.      * @var string
  24.      */
  25.     protected $file;
  26.  
  27.     /**
  28.      * Create a new job instance.
  29.      *
  30.      * @return void
  31.      */
  32.     public function __construct($file)
  33.     {
  34.         $this->file = $file;
  35.     }
  36.  
  37.     /**
  38.      * Execute the job.
  39.      *
  40.      * @return void
  41.      */
  42.     public function handle()
  43.     {
  44.         \Artisan::call('giacenze', [
  45.             'file' => $this->file,
  46.             '--force' => true
  47.         ]);
  48.         \Artisan::call('giacenzesplit', [
  49.             '--file' => $this->file
  50.         ]);
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement