title: laravel blade - variable not defined
body: <p>I have a table in my database called websites.</p>
  
  <p>Inside it I have two fields:</p>
  
  <p>name = with value "name"
  html = (whole html code stored in that field)</p>
  
  <p>So at the moment what I want to do is:</p>
  
  <p>If I type into a browser localhost/website/name which is the variable from database and after I hit enter I want to display actual rendered html page from a field html assosiated to that name so it looks like this:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Template 1&lt;/title&gt;
          &lt;link href="http://localhost/templates/css.css" rel="stylesheet" type="text/css"&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div class="logo"&gt;
          &lt;img class="images" id="image" src="#" alt="Your Logo"/&gt;
      &lt;/div&gt;
  &lt;div  contenteditable="true" id="content" class="draggable ui-widget-content refresh"&gt;&lt;p&gt;Change Text inside this box&lt;/p&gt;&lt;/div&gt;
  
  &lt;div id ="editTxt" class="refresh" contenteditable="true"&gt;
  &lt;p&gt;This text can be by the user.&lt;/p&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Obviously I don't want to see the code but the actual page. How can that be done?</p>
  
  <p>website.blade.php:</p>
  
  <pre><code>@extends('layouts.master') @section('title', 'Website Builder') @section('content')
  &lt;meta name="csrf-token" content="{{ csrf_token() }}" /&gt;
  
  
  {{html_entity_decode($website-&gt;html)}}
  
  
  &lt;/html&gt;
  @endsection @show
  </code></pre>
  
  <p>Route:</p>
  
  <pre><code>Route::get('website/{name}', 'BuilderController@websites');
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>function websites($name)
  {
      $websites = Website::find($name);
      return view('layouts/website');
  }
  </code></pre>
  
  <p>And current error message (assuming this code will display the page if this error is fixed)</p>
  
  <blockquote>
    <p>Undefined variable: website (View:
    C:\xampp\htdocs\fyproject\resources\views\layouts\website.blade.php)</p>
  </blockquote>
  
  <p>So basically value 'name' => 'null' and in my database it isn't so why is this happening?</p>