|
@@ -4,12 +4,13 @@ namespace Controller;
|
|
|
|
|
|
use Src\View;
|
|
|
use Illuminate\Database\Capsule\Manager as DB;
|
|
|
+use Model\Post;
|
|
|
|
|
|
class Site
|
|
|
{
|
|
|
public function index(): string
|
|
|
{
|
|
|
- $posts = DB::table('posts')->get();
|
|
|
+ $posts = Post::all();
|
|
|
return (new View())->render('site.post', ['posts' => $posts]);
|
|
|
}
|
|
|
|