diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 19f92d9..dc439c1 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -323,8 +323,8 @@ class HomeController extends Controller } public function news(){ - $news = NewsAndUpdate::where('status',1)->get(); - return view('news.blade.php',compact('news')) + $news_and_updates = NewsAndUpdate::where('status',1)->get(); + return view('news',compact('news_and_updates')); } } diff --git a/app/Http/Controllers/NewsController.php b/app/Http/Controllers/NewsController.php new file mode 100644 index 0000000..3b7f872 --- /dev/null +++ b/app/Http/Controllers/NewsController.php @@ -0,0 +1,14 @@ +get(); + return view('news_detail',compact('news')); + } +} diff --git a/resources/views/layout/app.blade.php b/resources/views/layout/app.blade.php index 9c226db..a015190 100644 --- a/resources/views/layout/app.blade.php +++ b/resources/views/layout/app.blade.php @@ -170,7 +170,6 @@ - diff --git a/resources/views/news.blade.php b/resources/views/news.blade.php index 12d314d..12b0c88 100644 --- a/resources/views/news.blade.php +++ b/resources/views/news.blade.php @@ -13,36 +13,39 @@
What’s New

News & Updates

+
+ @foreach($news_and_updates->skip(1) as $news)
-
+ @endforeach +
diff --git a/resources/views/news_detail.blade.php b/resources/views/news_detail.blade.php index f6f1d66..32c3a71 100644 --- a/resources/views/news_detail.blade.php +++ b/resources/views/news_detail.blade.php @@ -5,9 +5,9 @@ @section('content')
-

Recognition of Prior Learning (RPL)

+

{{$news->first()->title}}

-

Dec 09, 2022 . 2 min read

+

{{$news->first()->created_at}}

Share on
@@ -18,12 +18,12 @@
-

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letterset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letterset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry.

-
Where does it come from?
-

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letterset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularized in the 1960s with the release of Letterset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Lorem Ipsum is simply dummy text of the printing and typesetting industry.

+

{{$news->first()->description}}

+ +

{{$news->first()->bottom_description}}

diff --git a/routes/web.php b/routes/web.php index 4cf6fa9..4d84ec6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,7 +16,7 @@ use App\Http\Controllers\HomeController; use App\Http\Controllers\Admin\HomeController as HomeAdminController; use App\Http\Controllers\Admin\SliderController; use App\Http\Controllers\Admin\PartnerController; -use App\Http\Controllers\Admin\AcademyCourseController; +use App\Http\Controllers\NewsController; use App\Http\Controllers\Admin\NewsAndUpdateController; use App\Http\Controllers\Admin\SubOfficeController; use App\Http\Controllers\Admin\DepartmentController; @@ -60,13 +60,9 @@ Route::get('/service_detail', function(){ return view('service_detail'); }); -Route::get('/news', function(){ - return view('news'); -}); +Route::get('/news', [HomeController::class, 'news']); -Route::get('/news_detail', function(){ - return view('news_detail'); -}); +Route::get('/news/{slug}', [NewsController::class,'news_detail']); Route::get('/contact', [HomeController::class, 'contact']);