mirror of
https://github.com/Aviortheking/CA_LARAVEL.git
synced 2025-06-14 18:39:19 +00:00
add seeder for post & routing for list of post
This commit is contained in:
@ -4,6 +4,8 @@ namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
use DB;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
@ -13,7 +15,7 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
// $this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -33,4 +35,10 @@ class HomeController extends Controller
|
||||
return view('adminHome');
|
||||
|
||||
}
|
||||
public function blog() {
|
||||
|
||||
$posts = DB::table('posts')->get();
|
||||
|
||||
return view('blog', ['posts' => $posts]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user