Laravel 5.3, Class 找不到, 虽然路线是正确的
Laravel 5.3, Class cant be found, While the route is correct
我目前正在研究 view composer:
我现在遇到的问题是,我在 ComposerServiceProvider.php 中调用的路由说它找不到到 ViewComposers/LespakketComposer 的路由。php
在 Config\app.php 中我添加了正确的 App\Providers\ComposerServiceProvider::class,
这是我在 ComposerServiceProvider.php
中的代码
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\View;
class ComposerServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
View::composer('*','App\Http\ViewComposer\LespakketComposer');
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
//
}
}
这是我的错误:
ReflectionException in Container.php line 734:
Class App\Http\ViewComposer\LespakketComposer does not exist
The Routes in my folder structure
有人能解决我的问题吗?
(我请求的文件确实是 Class)
您忘记了 s
:
App\Http\ViewComposers\LespakketComposer
我目前正在研究 view composer:
我现在遇到的问题是,我在 ComposerServiceProvider.php 中调用的路由说它找不到到 ViewComposers/LespakketComposer 的路由。php
在 Config\app.php 中我添加了正确的 App\Providers\ComposerServiceProvider::class,
这是我在 ComposerServiceProvider.php
中的代码<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\View;
class ComposerServiceProvider extends ServiceProvider {
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
View::composer('*','App\Http\ViewComposer\LespakketComposer');
}
/**
* Register the application services.
*
* @return void
*/
public function register()
{
//
}
}
这是我的错误:
ReflectionException in Container.php line 734:
Class App\Http\ViewComposer\LespakketComposer does not exist
The Routes in my folder structure
有人能解决我的问题吗? (我请求的文件确实是 Class)
您忘记了 s
:
App\Http\ViewComposers\LespakketComposer