title: Undefined variable in Laravel 8
body: <p>I have issue with the undefined variable in Laravel 8, I actually don't understand why this happen because I was trying and playing with the Laravel 8.</p>
  <p>I created the same method and same coding but somehow when I tried to run the coding for page <code>about</code> I got the error that said</p>
  <blockquote>
  <p>ErrorException
  Undefined variable: about (View: D:\Server\htdocs\app\resources\views\pages\about.blade.php)</p>
  </blockquote>
  <p>Why is this happening ? I don't understand. Because I use the exact same coding for my other pages and it works but when I try to open the <code>about</code> page it suddenly give me the error when other pages are perfectly fine with no error.</p>
  <p><code>PagesController</code></p>
  <pre><code>class PagesController extends Controller
  {
      public function index()
      {   
          $title = &quot;Welcome to my blog&quot;;
          // return view ('pages.index', compact('title')); // first method 
  
          return view ('pages.index')-&gt;with('title',$title); // 2 method 
      }
  
      public function about()
      {
          $about = &quot;About Page&quot;;
          return view ('pages.about')-&gt;with('about',$about);
      }
      
      public function services()
      {
          $data = array(
              'title' =&gt;'Services' // array
          );
          return view ('pages.service')-&gt; with($data);
      }
      
      
  }
  </code></pre>
  <p><code>about.blade.php</code></p>
  <pre><code>
  @extends('layouts.app')
   
   @section('content')
          &lt;h1&gt;{{$about}} &lt;/h1&gt;
          &lt;p&gt; This is about pages &lt;/p&gt;
  @endsection
  </code></pre>
  <p><code>index.blade.php</code></p>
  <pre><code>@extends('layouts.app')
   
   @section('content')
          &lt;h1&gt;{{$title}} &lt;/h1&gt;
          &lt;p&gt; This is tutorial &lt;/p&gt;
  @endsection
  
  </code></pre>
  <p>Just to show you the same coding i use for <code>index</code> and <code>about</code></p>
  <p>My route if anyone asking</p>
  <pre><code>Route::get('/', [PagesController::class,'index']);
  Route::get('/about', [PagesController::class,'about']);
  Route::get('/services', [PagesController::class,'services']);
  </code></pre>
  <p><code>index.blade.php</code>
  <a href="https://i.stack.imgur.com/umEQ9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/umEQ9.png" alt="enter image description here" /></a></p>
  <p><code>about.blade.php</code>
  <a href="https://i.stack.imgur.com/Yb9QC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Yb9QC.png" alt="enter image description here" /></a></p>