I am using Laravel, and when I try to return a view in my controller nothing is showing up on the page.
View location: /resources/views/search.blade.php
Content of search.blade.php:
@extends( 'layouts.top10' )
@section( 'content' )
{{ $content }}
@endsection
Code in layout does NOT matter because it is working for many many other pages.
Code in controller (If I echo $content from the controller it shows up on the page, but nothin from the view or layout is shown):
public function show( $keyword ) {
$keyword = urldecode( $keyword );
$keyword_no_slash = str_replace( '-', ' ', $keyword );
$page = Page::where( 'title', 'like', $keyword_no_slash )->first();
Self::showPage( $page );
}
public function showPage( $page ) {
$content = "Test content";
// If I echo $content here, it is shown on the page
return view( 'search', compact( 'content' ) );
}
Route:
Route::get( '/{keyword}', 'SearchController@showPage');
There are no errors in my /storage/logs/laravel.log
There are no errors in my /var/log/apache2/error.log
I have already tried clearing my laravel view cache, and my cloudflare cache (plus it's in Dev mode)-- many times.
And nothing shops up on the page unless I echo it from the controller.
It seems like everything in the view is being completely ignored. I can even put php code that should error out, all I get is a blank screen.
Laravel Framework 5.5.43