Satyam Pathak
Satyam Pathak

Reputation: 6912

How to include a blade which is in public directory, #Laravel

I have uploaded blade file which is inside the

/public/storage/apps/{**MY FILE **}

And now I want to include that in my master view. I have used the normal syntax to achieve this.

@include('path')

but it doesn't work as it looks for the path of the view directory. I had also tried for'

@include(url('path'))

I am fresher and don't know how to address the path from the root directory.

Help will be appreciated. Thanx.

Upvotes: 1

Views: 2697

Answers (1)

Giedrius
Giedrius

Reputation: 1390

If you open up config/view.php file, you should be able to register multiple paths on there:

    /*
    |--------------------------------------------------------------------------
    | View Storage Paths
    |--------------------------------------------------------------------------
    |
    | Most templating systems load templates from disk. Here you may specify
    | an array of paths that should be checked for your views. Of course
    | the usual Laravel view path has already been registered for you.
    |
    */

    'paths' => [
        realpath(base_path('resources/views')),
    ],

Upvotes: 5

Related Questions