-
app/Jobs/DnaMatching.php
Open in GitHubuse Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; class DnaMatching implements ShouldQueue, TenantAware { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public function handle() { // $data = writeCSV(storage_path('app'.DIRECTORY_SEPARATOR.'dna'.DIRECTORY_SEPARATOR.'output'.DIRECTORY_SEPARATOR.$dm->file2), $data); } } }
-
app/Http/Controllers/DnaController.php
Open in GitHubuse App\Jobs\DnaMatching; use App\Models\Dna; use Auth; use Illuminate\Http\Request; class DnaController extends Controller { public function store(Request $request) { $currentUser = Auth::user(); $file_name = 'dna_'.$request->file('file')->getClientOriginalName().uniqid().'.'.$request->file('file')->extension(); $random_string = unique_random('dnas', 'variable_name', 5); $var_name = 'var_'.$random_string; $filename = 'app/dna/'.$file_name; DnaMatching::dispatch($currentUser, $var_name, $file_name); } } }