Esempio n. 1
0
 public function Gallery(Request $request, $galleryId)
 {
     $gallery = \Model\PhotoParent\ModelName::where('dostuk', '=', '1')->where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $dostukProjects = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', 1)->get();
     return view('Front::channel.dostuk.photos', ['images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery, 'dostukProjects' => $dostukProjects]);
 }
Esempio n. 2
0
 public function gallery(Request $request)
 {
     $id = $request->photoParentId;
     $row = \Model\PhotoParent\ModelName::where('id', '=', $id)->first();
     $images = json_decode($row->images);
     // array of images
     $lc = app()->getlocale();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::ns.gallery', ['lc' => $lc, 'images' => $images, 'row' => $row, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
Esempio n. 3
0
 public function post(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     $post->incrementViewed();
     // Photo Gallery
     $parent = \Model\PhotoParent\ModelName::where('id', '=', $post->parentId)->first();
     if ($parent) {
         $images = json_decode($parent->images);
     } else {
         $images = null;
     }
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::rs.post', ['post' => $post, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft, 'images' => $images]);
 }
Esempio n. 4
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('madaniyat')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('madaniyat', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     $lc = app()->getlocale();
     if ($lc == 'kg') {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('name', '<>', '')->get();
     } else {
         $madaniyatProjects = \Model\Project\ModelName::where('published', '=', true)->where('madaniyat', '=', 1)->where('nameRu', '<>', '')->get();
     }
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('madaniyat', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.madaniyat.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage, 'madaniyatProjects' => $madaniyatProjects]);
 }
Esempio n. 5
0
 public function Post(\Model\Post\ModelName $post)
 {
     $lc = app()->getlocale();
     $post->incrementViewed();
     $categories = \Model\Category\ModelName::all();
     $positionTop = \Model\Banner\ModelName::top()->first();
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     if ($post->parentId != '0' && $post->parentId != null) {
         $parentId = $post->parentId;
         $parentId = \Model\PhotoParent\ModelName::where('id', '=', $parentId)->first();
         $photoChilds = \Model\PhotoChild\ModelName::where('parentId', '=', $parentId->id)->get();
     } else {
         $parentId = '0';
         $photoChilds = '0';
     }
     if ($post->related1 != null) {
         $related1Post = \Model\Post\ModelName::where('id', '=', $post->related1)->first();
     } else {
         $related1Post = null;
     }
     if ($post->related2 != null) {
         $related2Post = \Model\Post\ModelName::where('id', '=', $post->related2)->first();
     } else {
         $related2Post = null;
     }
     if ($post->related3 != null) {
         $related3Post = \Model\Post\ModelName::where('id', '=', $post->related3)->first();
     } else {
         $related3Post = null;
     }
     if ($lc == 'kg') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languagekg()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     } elseif ($lc == 'ru') {
         $relatedPosts = \Model\Post\ModelName::where('category_id', '=', $post->category_id)->languageru()->take(6)->skip(0)->orderBy('id', 'desc')->get();
     }
     return view('Front::post.post', ['post' => $post, 'related1Post' => $related1Post, 'related2Post' => $related2Post, 'related3Post' => $related3Post, 'relatedPosts' => $relatedPosts, 'parentId' => $parentId, 'photoChilds' => $photoChilds, 'categories' => $categories, 'positionTop' => $positionTop, 'backgroundMain' => $backgroundMain]);
 }
Esempio n. 6
0
 public function Gallery(Request $request, $galleryId)
 {
     $gallery = \Model\PhotoParent\ModelName::where('muzkanal', '=', '1')->where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::channel.muzkanal.photos', ['images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery]);
 }
Esempio n. 7
0
 public function photodelete(Request $request)
 {
     $delete = $request->photoDeleteId;
     $photoParentId = $request->photoParentId;
     $photoParent = \Model\PhotoParent\ModelName::where('id', '=', $photoParentId)->first();
     $files = json_decode($photoParent->images);
     $file = array_only($files, $delete - 1);
     $name = last(last($file));
     $key = array_has($files, $delete);
     if ($key !== false) {
         unset($files[$delete - 1]);
         $storage = \Storage::delete('/froala/uploads/' . $name);
     }
     unset($files[$delete - 1]);
     $jsonFiles = json_encode($files);
     //dd($photoParent->images,$files,$jsonFiles);
     $photoParent->images = $jsonFiles;
     $photoParent->save();
     return redirect()->route('admin.photoParent.index');
 }
Esempio n. 8
0
 public function destroyChild(Request $request)
 {
     $photoDeleteId = $request->photoDeleteId;
     $photoChild = \Model\PhotoChild\ModelName::where('id', '=', $photoDeleteId)->first();
     $photoParentId = $request->photoParentId;
     $photoChild->delete();
     $photoParent = \Model\PhotoParent\ModelName::where('id', '=', $photoParentId)->first();
     return redirect()->route('admin.photoParent.show', $photoParent);
 }
Esempio n. 9
0
 public function allphotos()
 {
     $channel = \Model\Channel\ModelName::name('balastan')->first();
     $perPage = 24;
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     $postAll = \Model\Media\ModelName::where('published', '=', true)->where('balastan', '=', '1')->orderBy('id', 'desc')->paginate($perPage);
     // Photo Gallery
     $photoGalleries = \Model\PhotoParent\ModelName::where('balastan', '=', '1')->where('published', '=', true)->take('10')->orderBy('id', 'desc')->get();
     return view('Front::channel.balastan.allphotos', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'photoGalleries' => $photoGalleries, 'postAll' => $postAll, 'perPage' => $perPage]);
 }
Esempio n. 10
0
 public function Gallery(Request $request, $galleryId)
 {
     $lc = app()->getlocale();
     $gallery = \Model\PhotoParent\ModelName::where('id', '=', $galleryId)->first();
     $images = json_decode($gallery->images);
     $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first();
     return view('Front::gallery.gallery', ['lc' => $lc, 'images' => $images, 'backgroundMain' => $backgroundMain, 'gallery' => $gallery, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]);
 }
Esempio n. 11
0
 public function unpublish(Request $request)
 {
     $id = $request->photoParentId;
     $photoParent = \Model\PhotoParent\ModelName::where('id', '=', $id)->first();
     $photoParent->published = 0;
     $photoParent->save();
     return redirect()->route('admin.photoParent.index');
 }