7 months ago

(Laracast) Render Dynamic Data 2 - Stuck!

Posted 7 months ago by PT-83

During the Laracasts video, I'm following along setting up the articles webpage.

I'm stuck, for some reason, the articles webpage (which I called $blog) doesn't load a new screen or I get a 404 if I change the name in the layout file. Trying to figure this out for some time, I'm sure its something small I've missed but I honestly can't figure it out. I posted most of the code below hopefully... Any idea?

<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href=",300,400,600,700,900" rel="stylesheet" />
<link href="/css/default.css" rel="stylesheet" />
<link href="/css/fonts.css" rel="stylesheet" />

<div id="header-wrapper">
    <div id="header" class="container">
        <div id="logo">
            <h1><a href="/">SimpleWork</a></h1>
        <div id="menu">
                <li class="{{ Request::path() === '/' ? 'current_page_item' : '' }}"><a href="/" accesskey="1" title="">Homepage</a></li>
                <li class="{{ Request::path() === 'portfolio' ? 'current_page_item' : '' }}"><a href="#" accesskey="2" title="">Portfolio</a></li>
                <li class="{{ Request::path() === 'about' ? 'current_page_item' : '' }}"><a href="/about" accesskey="3" title="">About Us</a></li>
                <li class="{{ Request::path() === 'blogs' ? 'current_page_item' : '' }}"><a href="/show" accesskey="4" title="">Blog</a></li>
                <li class="{{ Request::path() === 'contact' ? 'current_page_item' : '' }}"><a href="#" accesskey="5" title="">Contact</a></li>

    @yield ('header')

@yield ('content')

<div id="copyright" class="container">
    <p>&copy; Untitled. All rights reserved. | Photos by <a href="">Fotogrph</a> | Design by <a href="" rel="nofollow">TEMPLATED</a>.</p>



Route::get('/', function () {
    return view('welcome');

Route::get('/about', function () {
    $blogs = App\Blog::take(3)->latest()->get();

    return view('/about', [
        'blogs' => $blogs

Route::get('/blogs/{blog}', '[email protected]');



namespace App\Http\Controllers;

use App\blog;
use Illuminate\Http\Request;

class BlogsController extends Controller
    public function show($id)

        $blog = Blog::find($id);

        return view('', ['blog'=> $blog]);


@extends ('layout')

@section ('content')

<div id="wrapper">
    <div id="page" class="container">
        <div id="content">
            <div class="title">
                <h2>{{ $blog->title }} </h2>
            <p><img src="/images/banner.jpg" alt="" class="image image-full" /> </p>
            {{ $blog->body }}

Please sign in or create an account to participate in this conversation.