That's because that file is not in the app/views directory. When you call @include('filename')
, Blade automatically looks for any file with that name, inside the apps/views directory. Also, you're not supposed to write the file extension, as Blade automatically looks for files with .blade.php
and .php
extensions.
If you want to use files from other directories on the @include
tag, add the directory to the paths array, on app/config/view.php. In your case, it'd be something like this:
app/config/view.php
<?php
// ...
'paths' => array(
__DIR__.'/../views',
__DIR__.'/../pages'
);
Then, you'd call it on blade like so:
@include('articles/first-post')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…