1

If I have multiple nested PHP files that relate to a view, where should I put them? In the app folder, resources\views folder, resources\assets folder?


resources\views folder structure:

enter image description here


lemon.blade.php contents:

@include('lemon.top.top')
@include('lemon.bottom.bottom')

If these subfiles aren't included in the resources\views folder, how do I reference them in lemon.blade.php?

3
  • this looks correct - saving within resources/views -- what's not working? Commented Jul 12, 2016 at 17:26
  • This works, but should I include MULTIPLE nested php files in the views folder, or should they be included elsewhere? Commented Jul 12, 2016 at 17:30
  • that's the spot for view files - nest it as deep as you need Commented Jul 12, 2016 at 19:29

2 Answers 2

2

They are to be created within resources\views.

If you are looking for best practices, you can create a partials folder within views, where you can even organize with more folders.

One suggestion made by Jeffrey Way from Laracasts, is to name all partials with a preceding _, so it's clearly differentiated from views.

Sign up to request clarification or add additional context in comments.

Comments

0

resources\assets is the space to include all your js, css, etc, resources in general

If your resources are related to an specific view, you could create a similar folder structure inside your assets folder

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.