This commit is contained in:
2025-06-06 17:53:01 +05:45
parent 9ceb854168
commit 793f6ec7da
15 changed files with 739 additions and 3 deletions

View File

@ -11,6 +11,7 @@ use App\Models\Preparation;
use App\Models\Service;
use App\Models\About;
use App\Models\Testimonial;
use App\Models\Blog;
class FrontendController extends Controller
{
@ -24,7 +25,10 @@ class FrontendController extends Controller
$data['testimonials'] = Testimonial::all();
// $data['partners'] = Partner::all();
// $data['passers'] = Passer::all();
// $data['blogs'] = Blog::latest()->take(3)->get();
$data['blogs'] = Blog::where('is_published', true)
->orderBy('display_order', 'asc')
->take(3)
->get();
return view('frontend.home',$data);
}
@ -33,6 +37,14 @@ class FrontendController extends Controller
$posts = Post::all();
return view('frontend.about', compact('posts'));
}
public function blogDetails($id)
{
$blog = Blog::findOrFail($id);
$otherBlogs = Blog::where('id', '!=', $id)->latest()->take(5)->get(); // Latest 5 except current
return view('frontend.blog-details', compact('blog', 'otherBlogs'));
}
}