我需要在我的项目中安装Laravel图表。
安装后composer require consoletvs/charts:6.*
我遇到此错误:
[RuntimeException]
Could not scan for classes inside "database/factories" which does not appear
to be a file nor a folder
所以当我在App文件夹中复制我的提供和同盟之后,我得到了:
Class 'ConsoleTVs\Charts\ChartsServiceProvider' not found
任何人都可以帮忙吗?
答案 0 :(得分:4)
我刚刚遇到了这个错误。这是因为我从数据库/工厂文件夹中删除了所有文件。修复的选项是将存根工厂文件重新添加到该文件夹中。 Laravel随附的UserFactory.php可以。
<?php
use Faker\Generator as Faker;
$factory->define(App\User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret
'remember_token' => str_random(10),
];
});
替代方法是从composer.json中删除
"classmap": [
"database/factories"
],
答案 1 :(得分:0)