Closed srakl closed 2 weeks ago
The issue might stem from how Blade is resolving the view paths and namespaces in Laravel: Can you please make sure below things:
Register Views in Service Provider: Ensure your module's service provider correctly registers the views.
// AbcServiceProvider.php
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../Resources/views', 'abc');
}
Use Correct Blade Directive:
Ensure you extend the layout correctly in pdf.blade.php
.
@extends('abc::layouts.pdf')
Clear View Cache: Clear the view cache to ensure changes are reflected.
php artisan view:clear
Debug Layout: Add a test message in your layout to ensure it loads.
<body>
<h1>Layout is loading</h1>
@yield('content')
</body>
Route and Controller: Ensure your route and controller return the correct view.
// web.php
Route::get('/pdf', 'PdfController@showPdf');
// PdfController.php
public function showPdf()
{
return view('abc::pdf.pdf');
}
in my module view i have these
Modules/Abc/Resources/views/layouts/pdf.blade.php
and in it i have thisand in my view
Modules/Abc/Resources/views/pdf/pdf.blade.php
i have thiswhen i go to the page, the page loads but not using the layout. any ideas why?