Search code examples
laravelsublimetext3laravel-bladehighlightyield

@yield('content') on laravel not working just plain white text


I've already installed Laravel Blade Highlighter..

@yield @section @endsection is not working, just a plain white text..

My views are working properly.. I can browser them okay..

Here's my code:

web.php:

    Route::get('/', 'PagesController@index');
Route::get('/about', 'PagesController@about');
Route::get('/services', 'PagesController@services');

pagesController.php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class PagesController extends Controller
{
    public function index(){
        return view('pages.index');;
    }

    public function about(){
        return view('pages.about');
    }

    public function services(){
        return view('pages.services');
    }

}

app.blade.php

<h1>This is the laravel</h1>
@yield('content')

index.php:

@extends('layouts.app')

@section('content')
    <h1>Welcome to Laravel</h1>
    <p>this is a content</p>
@endsection

Solution

  • The answer is I should close all open tab on my sublime text..

    And index.php, about.php and services.php should be index.blade.php, about.blade.php and services.blade.php