You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use App\Models\NewsAndUpdate;
|
|
|
|
use App\Models\Page;
|
|
|
|
|
|
|
|
class BlogController extends Controller
|
|
|
|
{
|
|
|
|
public function index(){
|
|
|
|
$page = Page::where(['title' => 'Blogs','status' => 1])->first();
|
|
|
|
$blogs = NewsAndUpdate::where('status',1)->get();
|
|
|
|
return view('blogs',compact('blogs','page'));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function blog_detail($slug){
|
|
|
|
$blog = NewsAndUpdate::where(['slug' => $slug, 'status' => 1])->first();
|
|
|
|
return view('blog-detail',compact('blog'));
|
|
|
|
}
|
|
|
|
}
|