无法调用 View:make 函数。我收到此错误:
return View::make('fb-post.index',['users'=>$users]);
Class 'App\Http\Controllers\View' not found
路线
Route::get('/', 'PostController@test');
控制器
public function test()
{
$customers = 'test';
return View::make('fb-post.index')->with('customers', $customers);
}
我的模板文件在 view/fb-post/index.blade.php
当我打电话时
php artisan dump-autoload
得到:
exception 'InvalidArgumentException' with message 'Command "dump-autoload" is not defined.' in /var/www/html/laravel-test/vendor/symfony/console/Symfony/Component/Console/Application.php:549
Stack trace:
#0 /var/www/html/laravel-test/vendor/symfony/console/Symfony/Component/Console/Application.php(192): Symfony\Component\Console\Application->find('dump-autoload')
#1 /var/www/html/laravel-test/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/laravel-test/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(91): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www/html/laravel-test/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#4 {main}
有任何想法吗?