news-and-dynamic-content

aplus/#11
Mahesh Sharma 2 years ago
parent be90e624cd
commit e978d94232
  1. 4
      app/Http/Controllers/HomeController.php
  2. 14
      app/Http/Controllers/NewsController.php
  3. 4
      resources/views/layout/app.blade.php
  4. 25
      resources/views/news.blade.php
  5. 12
      resources/views/news_detail.blade.php
  6. 10
      routes/web.php

@ -323,8 +323,8 @@ class HomeController extends Controller
} }
public function news(){ public function news(){
$news = NewsAndUpdate::where('status',1)->get(); $news_and_updates = NewsAndUpdate::where('status',1)->get();
return view('news.blade.php',compact('news')) return view('news',compact('news_and_updates'));
} }
} }

@ -0,0 +1,14 @@
<?php
namespace App\Http\Controllers;
use App\Models\NewsAndUpdate;
use Illuminate\Http\Request;
class NewsController extends Controller
{
public function news_detail($slug){
$news = NewsAndUpdate::where('slug',$slug)->get();
return view('news_detail',compact('news'));
}
}

@ -170,7 +170,6 @@
<!-- hamburger link --> <!-- hamburger link -->
<script type="text/javascript" src="{{url('frontend/js/index.js')}}"></script> <script type="text/javascript" src="{{url('frontend/js/index.js')}}"></script>
<script> <script>
var navHeader = document.getElementById('dice-nav-head'); var navHeader = document.getElementById('dice-nav-head');
window.onscroll= function(){ window.onscroll= function(){
@ -182,7 +181,8 @@
navHeader.classList.remove("header-scroll"); navHeader.classList.remove("header-scroll");
} }
} }
if(location.pathname === '/news_detail'){
if(location.pathname === '/news/'){
navHeader.classList.add("header-scroll"); navHeader.classList.add("header-scroll");
} }
</script> </script>

@ -13,36 +13,39 @@
<h5>What’s New <hr></h5> <h5>What’s New <hr></h5>
<h3>News & Updates</h3> <h3>News & Updates</h3>
</div> </div>
<div class="row mt-4"> <div class="row mt-4">
<div class="col-md-6"> <div class="col-md-6">
<div class="featured-news-image"> <div class="featured-news-image">
<img src="{{url('frontend/images/test-img.png')}}" class="img-fluid" alt=""> <img src="{{url($news_and_updates->first()->image ?? '')}}" class="img-fluid" alt="">
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<div class="featured-news-desc"> <div class="featured-news-desc">
<h3>Recognition of Prior Learning (RPL)</h3> <h3>{{$news_and_updates->first()->title}}</h3>
<h5>Dec 08, 2022</h5> <h5>{{$news_and_updates->first()->created_at}}</h5>
<p>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...</p> <p>{{\Illuminate\Support\Str::limit($news_and_updates->first()->description, 150, $end='...')}}</p>
<a href="/news_detail">Read More</a> <a href="{{url('news/'.$news_and_updates->first()->slug)}}">Read More</a>
</div> </div>
</div> </div>
</div> </div>
<div class="row g-4"> <div class="row g-4">
@foreach($news_and_updates->skip(1) as $news)
<div class="col-md-4"> <div class="col-md-4">
<div class="news-page-card"> <div class="news-page-card">
<a href="/news_detail"> <a href="{{url('news/'.$news->slug)}}">
<div class="news-card-img"> <div class="news-card-img">
<img src="{{url('frontend/images/test-img.png')}}" class="img-fluid" alt=""> <img src="{{url($news->image ?? '')}}" class="img-fluid" alt="">
</div> </div>
<div class="news-card-desc"> <div class="news-card-desc">
<h4>Lorem Ipsum is simply dummy text of the printing</h4> <h4>{{$news->title}}</h4>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's...</p> <p>{{\Illuminate\Support\Str::limit($news->description, 150, $end='...')}}</p>
</div> </div>
</a> </a>
</div> </div>
</div> </div>
<div class="col-md-4"> @endforeach
<!-- <div class="col-md-4">
<div class="news-page-card"> <div class="news-page-card">
<a href="/news_detail"> <a href="/news_detail">
<div class="news-card-img"> <div class="news-card-img">
@ -67,7 +70,7 @@
</div> </div>
</a> </a>
</div> </div>
</div> </div> -->
</div> </div>
</section> </section>

@ -5,9 +5,9 @@
@section('content') @section('content')
<section class="bloghead-section"> <section class="bloghead-section">
<div class="blog-header"> <div class="blog-header">
<h2>Recognition of Prior Learning (RPL)</h2> <h2>{{$news->first()->title}}</h2>
<div class="blog-social"> <div class="blog-social">
<p>Dec 09, 2022 . 2 min read</p> <p>{{$news->first()->created_at}}</p>
<div class="blog-share"> <div class="blog-share">
<h5>Share on</h5> <h5>Share on</h5>
<a href="https://www.facebook.com/people/A-Plus-Australia-Agency/100063871244808/" target="_blank"><img src="{{url('frontend/icons/facebook-icon.svg')}}" alt=""></a> <a href="https://www.facebook.com/people/A-Plus-Australia-Agency/100063871244808/" target="_blank"><img src="{{url('frontend/icons/facebook-icon.svg')}}" alt=""></a>
@ -18,12 +18,12 @@
</div> </div>
<div class="blog-desc mt-4"> <div class="blog-desc mt-4">
<div class="blog-featured-img"> <div class="blog-featured-img">
<img src="{{url('frontend/images/test-desc.png')}}" class="w-100" alt=""> <img src="{{url($news->first()->image)}}" class="w-100" alt="">
</div> </div>
<div class="blog-content mt-4"> <div class="blog-content mt-4">
<p>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.</p> <p>{{$news->first()->description}}</p>
<h5>Where does it come from?</h5> <!-- <h5>Where does it come from?</h5> -->
<p>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.</p> <p>{{$news->first()->bottom_description}}</p>
</div> </div>
</div> </div>
</section> </section>

@ -16,7 +16,7 @@ use App\Http\Controllers\HomeController;
use App\Http\Controllers\Admin\HomeController as HomeAdminController; use App\Http\Controllers\Admin\HomeController as HomeAdminController;
use App\Http\Controllers\Admin\SliderController; use App\Http\Controllers\Admin\SliderController;
use App\Http\Controllers\Admin\PartnerController; 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\NewsAndUpdateController;
use App\Http\Controllers\Admin\SubOfficeController; use App\Http\Controllers\Admin\SubOfficeController;
use App\Http\Controllers\Admin\DepartmentController; use App\Http\Controllers\Admin\DepartmentController;
@ -60,13 +60,9 @@ Route::get('/service_detail', function(){
return view('service_detail'); return view('service_detail');
}); });
Route::get('/news', function(){ Route::get('/news', [HomeController::class, 'news']);
return view('news');
});
Route::get('/news_detail', function(){ Route::get('/news/{slug}', [NewsController::class,'news_detail']);
return view('news_detail');
});
Route::get('/contact', [HomeController::class, 'contact']); Route::get('/contact', [HomeController::class, 'contact']);

Loading…
Cancel
Save