AppServiceProvider.php文件上的运行时错误。遵循我的代码
<?php
namespace AppProviders;
use IlluminateSupportServiceProvider;
use IlluminateSupportFacadesSchema;
use AppCategory;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
View::share('name','bitm');
View::composer('frontEnd.includes.menu',function($view){
$publishedCategories = Category::where('publicationStatus',1)->get();
$view->with('publishedCategories',$publishedCategories);
});
}
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}
}
有人能帮我吗??
您缺少名称空间IlluminateSupportFacadesView::share()
或
use IlluminateSupportFacadesView;
编辑
正如@d3jn所指出的,正确的方式就是use View;
。