private function getVideoPath($extra_id, $aspect = '16x9')
 {
     $extra = Extra::find($extra_id);
     if (!is_dir(base_path("/image/products-extras/{$aspect}"))) {
         $aspect = '16x9';
     }
     return base_path("/image/products-extras/{$aspect}/{$extra->video}");
 }
Esempio n. 2
0
 /**
  * Delete package.
  * @param  [int] $package_id [description]
  * @return [type]             [description]
  */
 public function deletePackage($package_id)
 {
     $extras = Extra::where('package_id', $package_id)->get();
     foreach ($extras as $key => $value) {
         Extrafile::where('extra_id', $value->id)->where('is_attached', 1)->delete();
         Extra::find($value->id)->delete();
     }
     Package::find($package_id)->delete();
 }
 /**
  * @param $extraId
  * @param string $errorType
  * @param string $aspect
  * @return \Illuminate\Http\JsonResponse
  */
 protected function getProductVideoPath($extraId, $errorType = '', $aspect = '')
 {
     $aspect = $aspect ?: '16x9';
     if (!is_dir($this->publicpath . $this->extra_path . $aspect)) {
         $aspect = '16x9';
     }
     $codes = $this->getUserCodes($extraId, $errorType);
     $extra = Extra::find($extraId);
     $this->filepath = $this->extra_path . $aspect . '/' . @$extra->video;
     return $codes;
 }