Wednesday, March 8, 2017

Laravel model factories not seen my application

I am trying to use Model Factories to generate some data while I work on an App. I have created the data which I can see in the database, however, when searching with tinker it can't find anything.

I have manually added an entry using Sequel Pro and Tinker can find that. What am I doing wrong?

So, for example:

id 25 was inserted by the model factory

id 26 was manually inserted by myself

$c = App\Models\Contact::find(25); retruns null

$c = App\Models\Contact::find(26); retruns the correct record



via Craig Ward

Advertisement