| @@ -83,13 +83,13 @@ discard block | ||
| 83 | 83 | |
| 84 | 84 |          // try { | 
| 85 | 85 |          return \Datatable::collection($this->product->select('id', 'name', 'type', 'group')->where('id', '!=', 1)->get()) | 
| 86 | -                        ->addColumn('#', function ($model) { | |
| 86 | +                        ->addColumn('#', function($model) { | |
| 87 | 87 | return "<input type='checkbox' value=".$model->id.' name=select[] id=check>'; | 
| 88 | 88 | }) | 
| 89 | -                        ->addColumn('name', function ($model) { | |
| 89 | +                        ->addColumn('name', function($model) { | |
| 90 | 90 | return ucfirst($model->name); | 
| 91 | 91 | }) | 
| 92 | -                        ->addColumn('type', function ($model) { | |
| 92 | +                        ->addColumn('type', function($model) { | |
| 93 | 93 | //dd($model->type()); | 
| 94 | 94 |                              if ($this->type->where('id', $model->type)->first()) { | 
| 95 | 95 |                                  return $this->type->where('id', $model->type)->first()->name; | 
| @@ -97,7 +97,7 @@ discard block | ||
| 97 | 97 | return 'Not available'; | 
| 98 | 98 | } | 
| 99 | 99 | }) | 
| 100 | -                        ->addColumn('group', function ($model) { | |
| 100 | +                        ->addColumn('group', function($model) { | |
| 101 | 101 | //dd($model->type()); | 
| 102 | 102 |                              if ($this->group->where('id', $model->group)->first()) { | 
| 103 | 103 |                                  return $this->group->where('id', $model->group)->first()->name; | 
| @@ -105,21 +105,21 @@ discard block | ||
| 105 | 105 | return 'Not available'; | 
| 106 | 106 | } | 
| 107 | 107 | }) | 
| 108 | -                        ->addColumn('price', function ($model) { | |
| 108 | +                        ->addColumn('price', function($model) { | |
| 109 | 109 |                              if ($this->price->where('product_id', $model->id)->first()) { | 
| 110 | 110 |                                  return $this->price->where('product_id', $model->id)->first()->price; | 
| 111 | 111 |                              } else { | 
| 112 | 112 | return 'Not available'; | 
| 113 | 113 | } | 
| 114 | 114 | }) | 
| 115 | -                        ->addColumn('currency', function ($model) { | |
| 115 | +                        ->addColumn('currency', function($model) { | |
| 116 | 116 |                              if ($this->price->where('product_id', $model->id)->first()) { | 
| 117 | 117 |                                  return $this->price->where('product_id', $model->id)->first()->currency; | 
| 118 | 118 |                              } else { | 
| 119 | 119 | return 'Not available'; | 
| 120 | 120 | } | 
| 121 | 121 | }) | 
| 122 | -                        ->addColumn('action', function ($model) { | |
| 122 | +                        ->addColumn('action', function($model) { | |
| 123 | 123 | $url = ''; | 
| 124 | 124 |                              if ($model->type == 2) { | 
| 125 | 125 |                                  $url = '<a href='.url('product/download/'.$model->id)." class='btn btn-sm btn-primary'>Download</a>"; | 
| @@ -175,14 +175,14 @@ discard block | ||
| 175 | 175 | 'type' => 'required', | 
| 176 | 176 | 'group' => 'required', | 
| 177 | 177 | ]); | 
| 178 | -        $v->sometimes(['file', 'image', 'version'], 'required', function ($input) { | |
| 178 | +        $v->sometimes(['file', 'image', 'version'], 'required', function($input) { | |
| 179 | 179 | return $input->type == 2 && $input->github_owner == '' && $input->github_repository == ''; | 
| 180 | 180 | }); | 
| 181 | 181 | |
| 182 | -        $v->sometimes(['github_owner', 'github_repository'], 'required', function ($input) { | |
| 182 | +        $v->sometimes(['github_owner', 'github_repository'], 'required', function($input) { | |
| 183 | 183 | return $input->type == 2 && $input->file == '' && $input->image == ''; | 
| 184 | 184 | }); | 
| 185 | -        $v->sometimes(['currency', 'price'], 'required', function ($input) { | |
| 185 | +        $v->sometimes(['currency', 'price'], 'required', function($input) { | |
| 186 | 186 | return $input->subscription != 1; | 
| 187 | 187 | }); | 
| 188 | 188 |          if ($v->fails()) { | 
| @@ -315,7 +315,7 @@ discard block | ||
| 315 | 315 |  //        $v->sometimes(['github_owner', 'github_repository'], 'required', function ($input) { | 
| 316 | 316 | // return $input->type == 2 && $input->file == '' && $input->image == ''; | 
| 317 | 317 | // }); | 
| 318 | -        $v->sometimes(['currency', 'price'], 'required', function ($input) { | |
| 318 | +        $v->sometimes(['currency', 'price'], 'required', function($input) { | |
| 319 | 319 | return $input->subscription != 1; | 
| 320 | 320 | }); | 
| 321 | 321 |          if ($v->fails()) { | 
| @@ -488,10 +488,10 @@ discard block | ||
| 488 | 488 |                  header('Content-type: Zip'); | 
| 489 | 489 |                  header('Content-Description: File Transfer'); | 
| 490 | 490 |                  header('Content-Disposition: attachment; filename=Faveo.zip'); | 
| 491 | -               //header("Content-type: application/zip"); | |
| 492 | -               header('Content-Length: '.filesize($release)); | |
| 493 | - //ob_clean(); | |
| 494 | - flush(); | |
| 491 | +                //header("Content-type: application/zip"); | |
| 492 | +                header('Content-Length: '.filesize($release)); | |
| 493 | + //ob_clean(); | |
| 494 | + flush(); | |
| 495 | 495 |                  readfile("$release"); | 
| 496 | 496 | exit; | 
| 497 | 497 | } | 
| @@ -526,10 +526,10 @@ discard block | ||
| 526 | 526 |                          header('Content-type: Zip'); | 
| 527 | 527 |                          header('Content-Description: File Transfer'); | 
| 528 | 528 |                          header('Content-Disposition: attachment; filename=Faveo.zip'); | 
| 529 | -               //header("Content-type: application/zip"); | |
| 530 | -                  header('Content-Length: '.filesize($release)); | |
| 531 | - //ob_clean(); | |
| 532 | - flush(); | |
| 529 | +                //header("Content-type: application/zip"); | |
| 530 | +                    header('Content-Length: '.filesize($release)); | |
| 531 | + //ob_clean(); | |
| 532 | + flush(); | |
| 533 | 533 |                          readfile("$release"); | 
| 534 | 534 | exit; | 
| 535 | 535 | } |