add blog detail

This commit is contained in:
jenoh
2020-03-13 16:29:16 +01:00
parent 092e42e197
commit a09f9b317b
4 changed files with 21 additions and 5 deletions

View File

@ -3,7 +3,7 @@
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Post;
use DB;
class HomeController extends Controller
@ -41,4 +41,7 @@ class HomeController extends Controller
return view('blog', ['posts' => $posts]);
}
public function detail($id) {
return view('detail',['post' => Post::findOrFail($id)]);
}
}