data = $this; if ($this->slide1 != '') $this->slide1 = @News::where('id', '=', $this->slide1)->first(); if ($this->slide2 != '') $this->slide2 = @News::where('id', '=', $this->slide2)->first(); if ($this->slide3 != '') $this->slide3 = @News::where('id', '=', $this->slide3)->first(); if ($this->slide4 != '') $this->slide4 = @News::where('id', '=', $this->slide4)->first(); if ($this->slide5 != '') $this->slide5 = @News::where('id', '=', $this->slide5)->first(); if ($this->left != '') $this->left = @News::where('id', '=', $this->left)->first(); if ($this->left1 != '') $this->left1 = @News::where('id', '=', $this->left1)->first(); if ($this->left2 != '') $this->left2 = @News::where('id', '=', $this->left2)->first(); if ($this->left3 != '') $this->left3 = @News::where('id', '=', $this->left3)->first(); if ($this->left4 != '') $this->left4 = @News::where('id', '=', $this->left4)->first(); if ($this->left5 != '') $this->left5 = @News::where('id', '=', $this->left5)->first(); if ($this->right1 != '') $this->right1 = @News::where('id', '=', $this->right1)->first(); if ($this->right2 != '') $this->right2 = @News::where('id', '=', $this->right2)->first(); if ($this->right3 != '') $this->right3 = @News::where('id', '=', $this->right3)->first(); if ($this->right4 != '') $this->right4 = @News::where('id', '=', $this->right4)->first(); if ($this->right5 != '') $this->right5 = @News::where('id', '=', $this->right5)->first(); } function hasSlider($type) { $tot = 0; if ($type == 'left') { if(isset($this->left1) && $this->left1 != '') $tot += 1; if(isset($this->left2) && $this->left2 != '') $tot += 1; if(isset($this->left3) && $this->left3 != '') $tot += 1; if(isset($this->left4) && $this->left4 != '') $tot += 1; if(isset($this->left5) && $this->left5 != '') $tot += 1; } if ($type == 'right') { if(isset($this->right1) && $this->right1 != '') $tot += 1; if(isset($this->right2) && $this->right2 != '') $tot += 1; if(isset($this->right3) && $this->right3 != '') $tot += 1; if(isset($this->right4) && $this->right4 != '') $tot += 1; if(isset($this->right5) && $this->right5 != '') $tot += 1; } return $tot > 1; } }