I have a database sample file:
class ContactTableSeeder extends Seeder { public function run() { $contacts = array( array( 'first_name' => 'Test', 'last_name' => 'Contact', 'email' => ' test.contact@emai.com ', 'telephone_number' => '0111345685', 'address' => 'Address', 'city' => 'City', 'postcode' => 'postcode', 'position' => 'Director', 'account_id' => 1 ) ); foreach ($contacts as $contact) { Contact::create($contact); } } }
When I run php artisan migrate: refresh --seed, it pops up the database and creates the corresponding entry in the contact table, except that it does not fill out the fields with any information in the seed array. I use the same syntax for other tables and they work fine, and I also carefully checked each field to make sure they match the fields of the database, but no matter what I do, it will not be the correct seed.
Does anyone have any ideas?
source share