mandarvb's avatar

Getting Method Illuminate\View\View::layout does not exist.

return view("myppath.to.childview") ->layout('mypath.to.parentview') ->with([ 'type' => $type, 'inputParams' => $inputParams, 'pageData' => $pageData, ]);

This is simple index() function in every controller of my module. All controller works fine in local ubuntu setup but I have hosted it on aws ubuntu server to test my project on live. But its giving me above error Getting Method Illuminate\View\View::layout does not exist. Any help on this? New to laravel and livewire

0 likes
6 replies
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Did you commit your composer.lock file and run composer install on the server? Sounds like its missing part of livewire

2 likes
mandarvb's avatar

@Sinnbeck Most likely this is the issue. But I did run composer install on production server.

mandarvb's avatar

yes I did. And I am not sure but its my Laravel controller not Livewire. This is my index method in every controller.

mandarvb's avatar

@Sinnbeck Okay. Thanks for your help. I reinstalled composer dependency, and its working now.

mandarvb's avatar

@Sinnbeck Can you please explain me this also?

Above code is my controller code DemoController.... { functionindex(){ ... and above return code as it is. } }

===============================+ mypath.to.parentview <x-layout.main-layout>

</x-layout.main-layout>

============================== main-layout // // //

// //<x-layout.head-layout/> //

// // //<x-layout.header-layout/> //

// //<x-layout.navigation-layout/> //<x-layout.content-layout/> //

// //<x-layout.footer-layout/> // // //

and all this header-layout and footer-layout have some basic html template code. with @yield('sectionReplace') where i load mypath.to.childview in general

Any issue in this structure? I know I have make it complex. But I did it while learning it

Please or to participate in this conversation.