When I try to use seed command in laravel then I get this error:
BadMethodCallException : Call to undefined method App\Model\Reply::Like()
I've tried everything:
<?php
/* @var $factory \Illuminate\Database\Eloquent\Factory */
use App\Model\Question;
use Faker\Generator as Faker;
use App\Model\Category;
use App\User;
$factory->define(Question::class, function (Faker $faker) {
$title = $faker->sentence();
return [
'title' => $title,
'slug' => str_slug($title),
'body' => $faker->text,
'category_id' => function() {
return Category::all()->random();
},
'user_id'=> function() {
return User::all()->random();
}
];
});
BadMethodCallException : Call to undefined method App\Model\Reply::Like()
from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2WsLQNm
via IFTTT
Aucun commentaire:
Enregistrer un commentaire