title: No query results for model [App\User] NULL 387 /laravel/framework/src/Illuminate/Database/Eloquent/Builder.php
body: <p>I know a similar question has been asked but the reasons for those error does not imply in my case because I am not fetching results anywhere in code.</p>
  <p>I am not using the 'find' or 'findOrFail' method anywhere in code.</p>
  <p>I am getting this error:</p>
  <pre><code>No query results for model [App\User] NULL 387 /laravel/framework/src/Illuminate/Database/Eloquent/Builder.php
  </code></pre>
  <p>My Excel import code:</p>
  <pre><code>&lt;?php
  
  namespace App\Imports;
  use Auth;
  use App\User;
  use App\EmployeePerformance;
  use Illuminate\Support\Collection;
  use Maatwebsite\Excel\Concerns\ToCollection;
  use Maatwebsite\Excel\Concerns\WithHeadingRow;
  use Illuminate\Support\Facades\Validator;
  use Illuminate\Validation\Rule;
  
  class HierarchyImport implements ToCollection, WithHeadingRow {
      
      public function collection(Collection $rows) {
          foreach ($rows as $row) {
              $user = $this-&gt;createUserNew($row, $row['role'], $row['parent_id']);
          }
      }
  
      /**
       * Transform a date value into a Carbon object.
       *
       * @return \Carbon\Carbon|null
       */
      public function transformDate($value, $format = 'Y-m-d'){
          try {
              return \Carbon\Carbon::instance(\PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($value));
          } catch (\ErrorException $e) {
              return \Carbon\Carbon::createFromFormat($format, $value);
          }
      }
  
      public function createUserNew($row, $role, $parent_id){
          $emp_id = $row['employee_id'];
          $name = $row['employee_name'];
          $email = $row['email'];
  
          $user = new User;
          $user-&gt;company_id = 1;
          $user-&gt;employee_id = $emp_id;
          $user-&gt;parent_id = $parent_id;
          $user-&gt;title = $row['title'];
          $user-&gt;region_number = 2;
          $user-&gt;name = trim(preg_replace('/[^A-Za-z0-9\-]/', ' ', $name));
          $user-&gt;email = $email;
          $user-&gt;email_verified_at = null;
          $user-&gt;gender = ($role == 'employee') ? $row['gender'] : null;
          $user-&gt;hire_date = ($role == 'employee') ? $this-&gt;transformDate($row['hire_date']) : null;
          $user-&gt;date_of_birth = null;
          $user-&gt;age = ($role == 'employee') ? $row['dob'] : null;
          $user-&gt;password = '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi'; // password
          $user-&gt;employee_status = 0;
  
          $user-&gt;save();
          if($user)
              //$user = $user-&gt;assignRole($role);
              return $user;
      }
  }
  </code></pre>
  <p>In my controller:</p>
  <pre><code>$import = new HierarchyImport;
  $importExcel = Excel::import($import, $request-&gt;file('file'));
  </code></pre>
  <p>PS:
  I tried <code>User::create($user);</code> but the same result, and the create method is returning the No query results for the model.</p>