/** * Run the database seeds. * * @return void */ public function run() { foreach ($this->types as $name) { ComputerType::firstOrCreate(compact('name')); } }
/** * Creates a computer type. * * @return ComputerType */ public function handle() { $name = $this->name; return ComputerType::firstOrCreate(compact('name')); }