Laravel不包含文件

Hello i am new to laravel framework and i am learning this framework and i am using blade templating engine for the separating the code.i have creating 2 file like sidebar.blade.php and footer.blade.php and i have to call both the file in my index .php but it's not working. my file is in my-project/layout/sidebar.blade.php folder

here is my code: index.php

<body class="nav-md">
    <div class="container body">
      <div class="main_container">
        @include('layouts.sidebar')
       </div>
    </div>
</body>

sidebar.blade.php

  <!-- footer content -->
    <footer>
      <div class="pull-right">
        Gentelella - Bootstrap Admin Template by <a href="https://colorlib.com">Colorlib</a>
      </div>
      <div class="clearfix"></div>
    </footer>
    <!-- /footer content -->

file structure : enter image description here

enter image description here

result :

enter image description here

The resources directory contains your views as well as your raw, un-compiled assets such as LESS, SASS, or JavaScript. This directory also houses all of your language files.

first you need to save all your view file with the extension of .blade.php Ex. 'yourfile-name.blade.php' and it must be in resources/views directory. If you want to add any new directory in that then you can add but when you include any file you have to specify the name of that directory like @include('your-folderName.bladeFileName');

For a default Laravel installation the @include() in @include('includes.sidebar') call will look for the file from project_rootesources\views directory. So just organize your view files that way and @include() it.

Another thing is, @include() is a blade directive. To use this you need a blade file first. So, I am guessing your index.php file should be index.blade.php

Please share structure of views folder. If you specify includes.sidebar then your sidebar.blade.php must in view/includes folder.

project_folder/resources/views/index.blade.php

<body class="nav-md">
    <div class="container body">
    <div class="main_container">
        @include('layout.sidebar')
    </div>
    </div>
</body>

project_folder/resources/views/layout/sidebar.blade.php

<hr>
<p>This is sidebar</p>
<hr>
<body class="nav-md">
<div class="container body">
  <div class="main_container">
    @include('layout.sidebar')
   </div>
</div>