Server : Apache System : Linux h2web276 4.9.0-0.bpo.12-amd64 #1 SMP Debian 4.9.210-1+deb9u1~deb8u1 (2020-06-09) x86_64 User : uid183121 ( 183121) PHP Version : 8.0.30 Disable Function : passthru,exec,system,popen,shell_exec,proc_open,pcntl_exec Directory : /home/clients/35966debc7d0d13be0a39d90b50635f3/sites/dd.noccanada.org/app/Imports/ |
Upload File : |
<?php namespace App\Imports; use App\Models\Person; use Maatwebsite\Excel\Concerns\ToModel; use Maatwebsite\Excel\Concerns\WithHeadingRow; class PeopleImport implements ToModel, WithHeadingRow { /** * @param array $row * * @return \Illuminate\Database\Eloquent\Model|null */ public function model(array $row) { return new Person([ 'identifier' => @$row['identifier'], 'first_name' => @$row['first_name'], 'last_name' => @$row['last_name'], 'email' => @$row['email'], 'org' => @$row['org'], 'street_num' => @$row['street_num'], 'suite' => @$row['suite'], 'street_name' => @$row['street_name'], 'city' => @$row['city'], 'prov' => @$row['prov'], 'postal' => @$row['postal'], 'phone_mobile1' => @$row['phone_mobile1'], 'phone_mobile2' => @$row['phone_mobile2'], 'phone_land' => @$row['phone_land'], 'telegram' => @$row['telegram'], 'person_type' => @$row['person_type'], 'response_area' => @$row['response_area'], 'response_type' => @$row['response_type'], 'notes' => @$row['notes'], 'superpower' => @$row['superpower'], 'created_at' => @$row['created_at'], 'updated_at' => @$row['updated_at'], 'contactPhone' => @$row['contactPhone'], 'contactPhone2' => @$row['contactPhone2'], 'contactEmail' => @$row['contactEmail'], 'contactLand' => @$row['contactLand'], 'country' => @$row['country'], 'status' => @$row['status'], 'telegramChatID' => @$row['telegramChatID'], ]); } }