2019-06-01 00:08:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
2019-07-10 16:11:25 +00:00
|
|
|
use Illuminate\Support\Facades\Mail;
|
|
|
|
|
use App\Mail\SendMail;
|
|
|
|
|
|
2019-06-01 00:11:14 +00:00
|
|
|
use App\Models\Menu;
|
|
|
|
|
use App\Models\Slider;
|
|
|
|
|
use App\Models\News;
|
|
|
|
|
use App\Models\Show;
|
|
|
|
|
use App\Models\PageSlider;
|
|
|
|
|
use App\Models\Description;
|
|
|
|
|
use App\Models\Advertisement;
|
|
|
|
|
use App\Models\Pagead;
|
|
|
|
|
use App\Models\Page;
|
2019-08-23 12:27:39 +00:00
|
|
|
use App\Models\Topheaderadv;
|
2019-06-01 00:08:36 +00:00
|
|
|
|
|
|
|
|
class WebController extends Controller
|
|
|
|
|
{
|
2019-08-23 13:58:03 +00:00
|
|
|
|
2019-06-01 00:08:36 +00:00
|
|
|
|
|
|
|
|
public function getShow ($showId){
|
|
|
|
|
$sliders = Slider::where('home', 1)->get();
|
|
|
|
|
$show = Show::findOrFail($showId);
|
2019-06-01 01:03:27 +00:00
|
|
|
$show->view++;
|
|
|
|
|
$show->save();
|
2019-06-01 00:08:36 +00:00
|
|
|
$showMenu = Show::orderBy('created_at', 'DESC')->take(6)->get();
|
|
|
|
|
return view('web.getShow')->with([
|
|
|
|
|
'sliders' => $sliders,
|
|
|
|
|
'show' => $show,
|
|
|
|
|
'showMenu' => $showMenu,
|
|
|
|
|
'title' => $show->name,
|
|
|
|
|
'keywords' => $show->name,
|
|
|
|
|
'meta_description' => $show->description,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAllShow ($pageId){
|
|
|
|
|
$page = Page::where('id', $pageId)->firstOrFail();
|
|
|
|
|
$sliders = $page->sliders;
|
|
|
|
|
$show = Show::orderBy('created_at', 'DESC')->paginate(6);
|
|
|
|
|
return view('web.getAllShow')->with([
|
|
|
|
|
'pageSliders' => $sliders,
|
|
|
|
|
'page' => $page,
|
|
|
|
|
'shows' => $show,
|
|
|
|
|
'title' => $page->name,
|
|
|
|
|
'keywords' => $page->name,
|
|
|
|
|
'meta_description' => $page->description,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAllAdv ($pageId){
|
|
|
|
|
$page = Page::where('id', $pageId)->firstOrFail();
|
|
|
|
|
$sliders = $page->sliders;
|
|
|
|
|
$advs = Pagead::orderBy('created_at', 'DESC')->paginate(6);
|
|
|
|
|
return view('web.getAllAdv')->with([
|
|
|
|
|
'pageSliders' => $sliders,
|
|
|
|
|
'page' => $page,
|
|
|
|
|
'advs' => $advs,
|
|
|
|
|
'title' => $page->name,
|
|
|
|
|
'keywords' => $page->name,
|
|
|
|
|
'meta_description' => $page->description,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAdv ($advId){
|
|
|
|
|
$sliders = Slider::where('home', 1)->get();
|
|
|
|
|
$adv = Pagead::findOrFail($advId);
|
|
|
|
|
$advMenu = Pagead::orderBy('created_at', 'DESC')->take(6)->get();
|
|
|
|
|
return view('web.getAdv')->with([
|
|
|
|
|
'sliders' => $sliders,
|
|
|
|
|
'adv' => $adv,
|
|
|
|
|
'advMenu' => $advMenu,
|
|
|
|
|
'title' => $adv->name,
|
|
|
|
|
'keywords' => $adv->name,
|
|
|
|
|
'meta_description' => $adv->description,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function newsList(){
|
|
|
|
|
$news = News::orderBy('created_at', 'DESC')->paginate(7);
|
|
|
|
|
$main = $news->shift();
|
|
|
|
|
return view('web.newsList')->with([
|
|
|
|
|
'news' => $news,
|
|
|
|
|
'main' => $main,
|
|
|
|
|
'title' => 'Habarlar',
|
|
|
|
|
'keywords' => 'Turkmen Tv Habarlar',
|
|
|
|
|
'meta_description' => 'Turkmen Tv Habarlar',
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getNews($newsId){
|
|
|
|
|
$news = News::findOrFail($newsId);
|
|
|
|
|
$newsMenu = News::orderBy('created_at', 'DESC')->take(6)->get();
|
|
|
|
|
return view('web.getNews')->with([
|
|
|
|
|
'news' => $news,
|
|
|
|
|
'newsMenu' => $newsMenu,
|
|
|
|
|
'title' => $news->name,
|
|
|
|
|
'keywords' => $news->name,
|
|
|
|
|
'meta_description' => $news->name,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-23 13:58:03 +00:00
|
|
|
|
2019-07-10 16:11:25 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-01 10:30:15 +00:00
|
|
|
// public function contacts(){
|
|
|
|
|
|
|
|
|
|
// return view('web.contact')->with([
|
|
|
|
|
// 'title' => 'Turkmen Tv | Habarlashyk',
|
|
|
|
|
// 'keywords' => '',
|
|
|
|
|
// 'meta_description' => '',
|
|
|
|
|
// ]);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// public function habarlashyk(){
|
|
|
|
|
|
|
|
|
|
// return view('web.habarlashyk')->with([
|
|
|
|
|
// 'title' => 'Turkmen Tv | Habarlashyk',
|
|
|
|
|
// 'keywords' => '',
|
|
|
|
|
// 'meta_description' => '',
|
|
|
|
|
// ]);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public function send(Request $request){
|
|
|
|
|
// $data = array(
|
|
|
|
|
// 'name' => $request->name,
|
|
|
|
|
// 'email' => $request->email,
|
|
|
|
|
// 'subject' => $request->subject,
|
|
|
|
|
// 'message' => $request->message
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
// Mail::to('mahabatmudirligi@gmail.com')->send(new SendMail($data));
|
|
|
|
|
// return back()->with('success', 'Hatyňyz Üstünlikli ugradyldy.');
|
2019-07-10 16:11:25 +00:00
|
|
|
|
2019-08-01 10:30:15 +00:00
|
|
|
// }
|
2019-06-01 00:08:36 +00:00
|
|
|
}
|