PostsSeeder.php
<?php
use Illuminate\Database\Seeder;
use Faker\Factory as Faker;
use \App\Models\Post as Post;
class PostsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = Faker::create();
Post::truncate();
for($i = 0; $i < 5; $i++){
Post::create([
'title'=>$faker->word(2),
'body'=>$faker->paragraph(20),
// 'preview'=>$faker->imageUrl(200,200 ),
// 'author'=>$faker->name(1),
]);
}
}
}
DatabaseSeeder.php
<?php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class DatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
$this->call('PostsSeeder');
Model::reguard();
}
}
пишу в терминале php artisan db:seed
и получаю такую ошибку [ReflectionException]
Class PostsSeeder does not exist
почему ведь все верно указанно ?