progress
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use App\Models\Economies;
|
||||
use App\Models\News;
|
||||
use App\Models\News_type;
|
||||
use App\Models\Newscategories;
|
||||
use App\Models\Provinces;
|
||||
|
||||
class WebsiteController extends Controller
|
||||
{
|
||||
@ -12,10 +17,39 @@ class WebsiteController extends Controller
|
||||
}
|
||||
|
||||
public function home(){
|
||||
return view($this->path.'.home');
|
||||
$data['featuredNews'] = News::where('featured_news',"True")->where('status',1)->first();
|
||||
|
||||
$data['provinces'] = Provinces::with('provinceNews')->limit(5)->get();
|
||||
|
||||
$data['categories'] = Newscategories::with('news')->get();
|
||||
$data['interviews'] = Newscategories::with('interviewNews')->get();
|
||||
$data['politics'] = Newscategories::with('politicNews')->get();
|
||||
// $data['economics'] = Newscategories::with('news')->inRandomOrder()->get();
|
||||
$data['economics'] = Economies::with('news')
|
||||
->orderBy('display_order')
|
||||
->where('status',1)
|
||||
->get();
|
||||
|
||||
$data['sports'] = Newscategories::with('sportNews')->get();
|
||||
$data['cultural'] = Newscategories::with('culturalNews')->get();
|
||||
$data['technology'] = Newscategories::with('technologyNews')->get();
|
||||
$data['entertainment'] = Newscategories::with('entertainmentNews')->get();
|
||||
// dd($data['entertainment']);
|
||||
|
||||
$data['internationalNews'] = News_type::with('news')->get();
|
||||
|
||||
|
||||
|
||||
// dd($data['internationalNews']);
|
||||
|
||||
return view($this->path.'.home',$data);
|
||||
}
|
||||
|
||||
public function single(){
|
||||
return view($this->path.'.single');
|
||||
}
|
||||
|
||||
public function newsDetail(){
|
||||
return view($this->path.'.news-detail');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user