Level 104
Yes. Use a different relationship name.
1 like
I have got a table named fatories. There is another table with relationship below to the factories table.
public function factory()
{
return $this->belongsTo(Factory::class);
}
This mathod's name crashing with the laravel factory method. It cause problem when I try to run factory to seed the database.
Is there a way to resolve this ?
@anchan42 you can; but I don't know if you should:
use HasFactory {
factory as modelFactory;
}
In the long run, sticking to the conventional use of factory in your tests will lead to less confusion IMHO
Please or to participate in this conversation.