public function posts() { $perPage = 10; $lc = app()->getlocale(); if ($lc == 'kg') { $postAll = \Model\Post\ModelName::where('rs', '=', '1')->where('title', '<>', '')->orderBy('id', 'desc')->paginate($perPage); } elseif ($lc == 'ru') { $postAll = \Model\Post\ModelName::where('rs', '=', '1')->where('title', '<>', '')->orderBy('id', 'desc')->paginate($perPage); } $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first(); return view('Front::rs.posts', ['postAll' => $postAll, 'perPage' => $perPage, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]); }
public function categoryPage(\Model\Category\ModelName $category) { $category_id = $category->id; $posts = \Model\Post\ModelName::where('category_id', '=', $category_id)->get(); $positionTop = \Model\Banner\ModelName::where('positionTop', '=', '1')->first(); $positionRight = \Model\Banner\ModelName::where('positionRight', '=', '1')->first(); $positionCenter = \Model\Banner\ModelName::where('positionCenter', '=', '1')->first(); $positionBottom = \Model\Banner\ModelName::where('positionBottom', '=', '1')->first(); $categories = \Model\Category\ModelName::all(); $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first(); return view('Front::category.index', ['posts' => $posts, 'category' => $category, 'positionTop' => $positionTop, 'positionRight' => $positionRight, 'positionCenter' => $positionCenter, 'positionBottom' => $positionBottom, 'categories' => $categories, 'backgroundMain' => $backgroundMain]); }
public function allnews() { $channel = \Model\Channel\ModelName::name('dostuk')->first(); $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first(); $lc = app()->getlocale(); if ($lc == 'kg') { $allPost = \Model\Post\ModelName::where('dostuk', '=', 1)->languagekg()->published()->orderBy('id', 'desc')->get(); } else { $allPost = \Model\Post\ModelName::where('dostuk', '=', 1)->languageru()->published()->orderBy('id', 'desc')->get(); } $dostukProjects = \Model\Project\ModelName::where('published', '=', true)->where('dostuk', '=', 1)->get(); return view('Front::channel.dostuk.allnews', ['channel' => $channel, 'backgroundMain' => $backgroundMain, 'allPost' => $allPost, 'dostukProjects' => $dostukProjects]); }
public function twoRelatedFunction($postId, $postId2) { $relatedPost = \Model\Post\ModelName::where('id', '=', $postId)->first(); $relatedPost2 = \Model\Post\ModelName::where('id', '=', $postId2)->first(); return '<div> <aside> <div class="topics-box"> <h2>' . trans('site.MatpoTeme') . '</h2> <div class="topics"> <div class="topic clearfix"> <div class="t-date"> <span class="date"> <span class="time">' . $relatedPost->getTime() . '</span> ' . $relatedPost->getDay() . ' ' . $relatedPost->getMonthRu() . ', ' . $relatedPost->getYear() . ' </span> </div> <a class="t-thumb" href="' . route('front.post', $postId) . '"> <img alt="alt photo text" src="' . asset($relatedPost->getFile()) . '"> </a> <div class="t-info"> <a class="js-dh" href="' . route('front.post', $postId) . '">' . $relatedPost->getTitle() . '</a> </div> </div> <div class="topic clearfix"> <div class="t-date"> <span class="date"> <span class="time">' . $relatedPost2->getTime() . '</span> ' . $relatedPost2->getDay() . ' ' . $relatedPost2->getMonthRu() . ', ' . $relatedPost2->getYear() . ' </span> </div> <a class="t-thumb" href="' . route('front.post', $postId) . '"> <img alt="alt photo text" src="' . asset($relatedPost2->getFile()) . '"> </a> <div class="t-info"> <a class="js-dh" href="' . route('front.post', $postId) . '">' . $relatedPost2->getTitle() . '</a> </div> </div> </div> </div> </aside></div> '; }
public function categoryPage(\Model\Category\ModelName $category) { $channel = \Model\Channel\ModelName::general(); $perPage = 10; $category_id = $category->id; $posts = \Model\Post\ModelName::where('category_id', '=', $category_id)->get(); $categories = \Model\Category\ModelName::all(); $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first(); return view('Front::category.index', ['perPage' => $perPage, 'posts' => $channel->posts()->paginate($perPage), 'category' => $category, 'categories' => $categories, 'backgroundMain' => $backgroundMain]); }
public function directorPost(\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::pages.directorPost', ['post' => $post, 'related1Post' => $related1Post, 'related2Post' => $related2Post, 'related3Post' => $related3Post, 'relatedPosts' => $relatedPosts, 'parentId' => $parentId, 'photoChilds' => $photoChilds, 'categories' => $categories, 'positionTop' => $positionTop, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]); }
public function categoryPage(\Model\Category\ModelName $category) { $lc = app()->getlocale(); $perPage = 10; $category_id = $category->id; if ($lc == 'kg') { $posts = \Model\Post\ModelName::where('category_id', '=', $category_id)->where('title', '<>', '')->orderBy('id', 'desc')->paginate($perPage); } else { $posts = \Model\Post\ModelName::where('category_id', '=', $category_id)->where('titleRu', '<>', '')->orderBy('id', 'desc')->paginate($perPage); } $categories = \Model\Category\ModelName::all(); $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first(); return view('Front::category.index', ['perPage' => $perPage, 'posts' => $posts, 'category' => $category, 'categories' => $categories, 'backgroundMain' => $backgroundMain, 'positionTop' => $this->positionTop, 'positionRight' => $this->positionRight, 'positionCenter' => $this->positionCenter, 'positionBottom' => $this->positionBottom, 'positionLeft' => $this->positionLeft]); }
public function unnumber(Request $request, $number) { $postId = $number; $row = \Model\Post\ModelName::where('id', '=', $postId)->first(); $row->number = 99; $row->save(); return redirect()->route('admin.media.index'); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(Post $post) { $PhotoParentList = \Model\PhotoParent\ModelName::lists('name', 'id')->toArray(); $relatedPosts = \Model\Post\ModelName::where('title', '<>', '')->lists('title', 'id')->toArray(); $relatedPosts2 = \Model\Post\ModelName::where('titleRu', '<>', '')->lists('titleRu', 'id')->toArray(); $tags = \Model\Tag\Tag::lists('name', 'id'); $tags2 = \Model\Tag\Tag::lists('name', 'id'); return view('Admin::post.edit', ['post' => $post, 'tags' => $tags, 'tags2' => $tags2, 'relatedPosts' => $relatedPosts, 'relatedPosts2' => $relatedPosts2, 'PhotoParentList' => $PhotoParentList]); }
public function broadcasts(\Model\Project\ModelName $project) { $lc = app()->getlocale(); if ($lc == 'kg' && $project->name != '') { } elseif ($lc == 'ru' && $project->nameRu != '') { } else { return redirect()->route('birinchi.home'); } $projectList = \Model\Project\ModelName::get(); // $MediaCategory = \Model\MediaCategory\ModelName::get(); $mediaAll = \Model\Media\ModelName::get(); $mainBanner = \Model\Background\ModelName::where('name', '=', 'main')->first(); $categories = \Model\Category\ModelName::all(); $backgroundMain = \Model\Background\ModelName::where('published', '=', true)->first(); $relatedNews = \Model\Post\ModelName::where('published', '=', true)->where('birinchi', '=', '1')->where('birinchiProgram', '=', $project->id)->get(); // dd($relatedNews); $lc = app()->getlocale(); if ($lc == 'kg') { $birinchiProjects = \Model\Project\ModelName::where('published', '=', true)->where('birinchi', '=', 1)->where('name', '<>', '')->get(); } else { $birinchiProjects = \Model\Project\ModelName::where('published', '=', true)->where('birinchi', '=', 1)->where('nameRu', '<>', '')->get(); } return view('Front::channel.birinchi.broadcasts', ['project' => $project, 'mainBanner' => $mainBanner, 'categories' => $categories, 'projectList' => $projectList, 'backgroundMain' => $backgroundMain, 'relatedNews' => $relatedNews, 'birinchiProjects' => $birinchiProjects]); }