Ad

How To Addressing Package View On Laravel 5.1

I have modules folder in root directory Laravel 5.1.
and located a package as test1 in this. Also I have file view1.blade.php in this directory

resources/views/view1.blade.php

How to can access in View1.blade.php from this address

modules/test1/View/test.blade.php

I use this command in View1 file but not work correctly

@include "modules/test1/View/test";

and this command

@include('modules::test')
Ad

Answer

You must define a name for view in PackageSeviceProvider like this:

// Define path for view files
$this->loadViewsFrom(__DIR__.'/View','PackageView');

and in Blade Template use:

@include ('PackageView::Addpage')
Ad
source: stackoverflow.com
Ad