Add (debugbar)
Update (post detail): Show detailed post Update (post url): Improve url structure
This commit is contained in:
@@ -14,7 +14,19 @@
|
||||
|
||||
class FrontPostController extends Controller
|
||||
{
|
||||
public function index(Request $request, $slug)
|
||||
public function redirect(Request $request, $slug)
|
||||
{
|
||||
$post = Post::where('slug', $slug)->where('status', 'publish')->first();
|
||||
|
||||
if (is_null($post)) {
|
||||
return abort(404);
|
||||
}
|
||||
|
||||
return redirect()->route('front.post',['category_slug' => $post->category->slug, 'slug' => $post->slug]);
|
||||
|
||||
}
|
||||
|
||||
public function index(Request $request, $category_slug, $slug)
|
||||
{
|
||||
$post = Post::where('slug', $slug)->where('status', 'publish')->first();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user