0
votes

I am trying to add a new view to my laravel project, and it is just dumping the entire content on the page, including my blade code, instead of executing said code. For example, my page in the browser is this:

@extends('user.layouts.app') @section('title', 'New Reminder') @section('content') New Reminder @csrf Title Content @endsection

When it should obviously be executing that code, not putting it on the page.

I have tried clearing the routes, and researched around but no dice.

I am calling this view the same way I am calling others in my code - in the controller like this:

return view('user.partials.stat_types.new_type');

Any help or advise is appreciated!

1
what did you name this file? - lagbox
@lagbox - ah thank you, I forgot to add blade into the file extension. Adding that fixed it right up. You'd think I would have noticed that with it being next to other files with the correct extension. - paigem33

1 Answers

2
votes

You must have the file name with the extension .blade.php if you want Blade to be used to compile the view. With just .php the PHP engine is used.

Change your view filename to have the .blade.php extension.