@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('exports', function (Blueprint $table) { |
|
16 | + Schema::create('exports', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('file', 255)->nullable(); |
19 | 19 | $table->string('type', 10); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('imports', function (Blueprint $table) { |
|
16 | + Schema::create('imports', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->string('file', 255); |
19 | 19 | $table->integer('file_rows'); |
@@ -13,7 +13,7 @@ |
||
13 | 13 | */ |
14 | 14 | public function up() |
15 | 15 | { |
16 | - Schema::create('import_export_logs', function (Blueprint $table) { |
|
16 | + Schema::create('import_export_logs', function(Blueprint $table) { |
|
17 | 17 | $table->increments('id'); |
18 | 18 | $table->integer('op_id'); |
19 | 19 | $table->longText('data'); |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | $this->artisan('migrate', ['--database' => 'testing']); |
35 | 35 | |
36 | - Route::middleware('web')->group(function () { |
|
36 | + Route::middleware('web')->group(function() { |
|
37 | 37 | Route::get('/import/{id}/progress', ['as' => 'ladybirdweb.import.ajax.progress', 'uses' => 'Ladybirdweb\ImportExport\Import@returnImportProgress']); |
38 | 38 | }); |
39 | 39 |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | $this->artisan('migrate', ['--database' => 'testing']); |
36 | 36 | |
37 | - Route::middleware('web')->group(function () { |
|
37 | + Route::middleware('web')->group(function() { |
|
38 | 38 | Route::get('/ticket/export/{id}', ['as' => 'ticket.export.progress', 'uses' => 'Ladybirdweb\ImportExport\Export@showExportStatus']); |
39 | 39 | |
40 | 40 | Route::get('/export/{id}/download', ['as' => 'ladybirdweb.export.download', 'uses' => 'Ladybirdweb\ImportExport\Export@downloadExportedFile']); |
@@ -55,7 +55,7 @@ |
||
55 | 55 | // Map export instance |
56 | 56 | $export = ModelExport::findOrFail($id); |
57 | 57 | |
58 | - if (! file_exists(storage_path('app/exports').'/'.$export->file) || empty($export->file)) { |
|
58 | + if (!file_exists(storage_path('app/exports').'/'.$export->file) || empty($export->file)) { |
|
59 | 59 | abort(404); |
60 | 60 | } |
61 | 61 |
@@ -47,13 +47,13 @@ |
||
47 | 47 | $export->save(); |
48 | 48 | |
49 | 49 | // Create export file |
50 | - $excel = Excel::create('export-'.date('dmYhis'), function ($excel) use ($export) { |
|
50 | + $excel = Excel::create('export-'.date('dmYhis'), function($excel) use ($export) { |
|
51 | 51 | |
52 | 52 | // Create new sheet |
53 | - $excel->sheet('export', function ($sheet) use ($export) { |
|
53 | + $excel->sheet('export', function($sheet) use ($export) { |
|
54 | 54 | |
55 | 55 | // Retrive data in chunk |
56 | - $export->query->chunk(10, function ($data) use ($export, $sheet) { |
|
56 | + $export->query->chunk(10, function($data) use ($export, $sheet) { |
|
57 | 57 | |
58 | 58 | // Process chunk data |
59 | 59 | foreach ($data as $row) { |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -Route::middleware('web')->group(function () { |
|
3 | +Route::middleware('web')->group(function() { |
|
4 | 4 | |
5 | 5 | // Ajax GET import progress |
6 | 6 | Route::get(config('import.import_progress.url'), ['as' => config('import.import_progress.name'), 'uses' => 'Ladybirdweb\ImportExport\Import@returnImportProgress']); |