title: Laravel 7 - Trait 'Laravel\Sanctum\HasApiTokens' not found
body: <p>I am working with iframes and I am trying to compare the user's email with the teacher's email with eloquent. That would be the condition to list only the groups of that teacher, but it gives me this error:</p>
  <blockquote>
  <p>Trait 'Laravel\Sanctum\HasApiTokens' not found</p>
  </blockquote>
  <ul>
  <li>This is my function</li>
  </ul>
  <pre><code>    public function index($id)
          {
               $email = User::select('email')-&gt;where('id', $id)-&gt;get();
      
              $groups= DB::table('groups')
              -&gt;join('teacher_group', 'grupo_profesor.idGrupo', '=', 'groups.idGrupo')
              -&gt;join('teachers', 'teachers.idTeacher', '=', 'teacher_group.idTeacher')
              -&gt;join('level_group', 'level_group.idGroup', '=', 'groups.idGroup')
              -&gt;join('levels', 'levels.idLevel', '=', 'level_group.idLevel')
              -&gt;join('courses', 'courses.idCourse', '=', 'levels.idCourse')
              -&gt;join('programs', 'programs.idProgram', '=', 'courses.idProgram')
              -&gt;where('teachers.email', '=', $email)
              -&gt;paginate(10);
               
          return view('teacherGroups.index', compact('groups','email'));
          }
  
  </code></pre>
  <ul>
  <li>The sidebar button</li>
  </ul>
  <pre><code>
  &lt;button class=&quot;list-group-item list-group-item-action small text-secondary&quot; 
  onclick=&quot;crearTabAndIframe('TeacherGroups','teacherGroups');
  Loadiframe('{{ url('Groups/Teacher/'.auth()-&gt;user()-&gt;id)}}','ifrmTeacherGroups')&quot;&gt;
  
       &lt;i class=&quot;material-icons&quot;&gt;list&lt;/i&gt; @lang('menu.List')
  
  &lt;/button&gt;
  
  </code></pre>
  <ul>
  <li>This is the index view</li>
  </ul>
  <pre><code>
       @foreach($groups as $group)   
      &lt;tr&gt;
          &lt;td class=&quot;small text-center&quot;&gt;{{$group-&gt;idGroup}}&lt;/td&gt;
      
          &lt;td class=&quot;small  text-center&quot;&gt;{{$group-&gt;levelName}} {{$group-&gt;courseName}} {{$group-&gt;programName}}&lt;/td&gt;
      
          &lt;td class=&quot;small  text-center&quot;&gt;{{$group-&gt;teacher_name}}&lt;/td&gt;
          
          &lt;td class=&quot;small  text-center&quot;&gt;
              &lt;div class=&quot;row small&quot;&gt;
                  &lt;div &gt;
                      &lt;!--VIEW--&gt;
                      &lt;button onclick=&quot;seeGroup({{$group-&gt;idGroup}})&quot; class=&quot;btn btn-sm btn-outline-success&quot;&gt;
                          &lt;i class=&quot;material-icons&quot;&gt;remove_red_eye&lt;/i&gt;
                      &lt;/button&gt;
                  &lt;/div&gt;    
              &lt;/div&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      @endforeach
  
  </code></pre>
  <ul>
  <li>And with the error it shows me this part of my model</li>
  </ul>
  <pre><code>
      class User extends Authenticatable
      
      {
      
          use HasApiTokens, HasFactory, Notifiable;
      
       
      
          /**
      
           * The attributes that are mass assignable.
      
           *
      
           * @var string[]
      
           */
      
          protected $fillable = [
      
              'name',
      
              'email',
      
              'password',
      
          ];
  
  </code></pre>