Laravel 5.4 - @extends not working

Viewed 1925

I have two main views in Laravel.

Both are called as follows, in web.php:

Route::get('/characters', 'CharacterController@index');
Route::get('/characters/{char_id}', 'CharacterController@viewCharacter');

Here's their function in CharacterController:

/characters:

public function index()
{



$characters = Character::userChars();

return view('pages.characters', compact('characters') );


}

characters/{char_id}:

public function viewCharacter ($char_id)

{

    $character = \DB::table('characters')->where('char_id', $char_id)->first();

    return view('pages.view-character', compact('character') );


}

/characters works fine. It uses

@extends('layouts.master')

@section('content')

@endsection

All the content loads fine and the CSS displays.

However, characters/{char_id} refuses to work correctly.

It displays the content from @extends but will not render the CSS at all.

This is the blade template for characters/{char_id}:

@extends('layouts.master')

@section('content')

<div id="page-wrapper">

            <div class="container-fluid">

                <!-- Page Heading -->
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">
                            Template <small>Template Page</small>
                        </h1>
                        <ol class="breadcrumb">
                            <li class="active">
                                <i class="fa fa-dashboard"></i> Template 1

                            </li>
                        </ol>
                    </div>
                </div>








            </div>
</div>

@endsection

It is identical to the view that /characters uses, except for what's in the content section.

Here is "master.blade.php": https://pastebin.com/kjnxc0ms

Thanks!

2 Answers
Related