title: InvalidFieldNameException in my findOneBy
body: <p>I have an error then</p>
  <pre><code>$resetPassword =$resetPasswordRepository-&gt;findOneBy(['token' =&gt; $request-&gt;token]);
  </code></pre>
  <p>error:</p>
  <pre><code> InvalidFieldNameException
      An exception occurred while executing 'SELECT t0.id AS id_1, t0.email AS email_2, t0.token AS token_3, t0.created_at AS created_at_4 FROM reset_passwords t0 WHERE t0.token = ? LIMIT 1' with params [&quot;EF5i4ooFh6ThHqDsSQKaEGzfIejpZvRaLP8Xtg0diTpEQEsl6buFRlHM7WfVZBzx&quot;]:
      
      SQLSTATE[42S22]: Column not found: 1054 Unknown column 't0.id' in 'field list'
  </code></pre>
  <p>in my controller</p>
  <pre><code>class ResetPasswordController extends Controller
  {
      private $request;
  
      public function showForgetPasswordForm()
      {
          return view('auth.forgetPassword');
      }
  
  
      public function submitForgetPasswordForm(ForgetPasswordRequest $request)
      {
          $this-&gt;request = $request-&gt;validated();
  
          $reset_password = new ResetPassword();
          $reset_password-&gt;setEmail($request-&gt;email);
          $reset_password-&gt;setToken(Str::random(64));
          $reset_password-&gt;setCreated_at(Carbon::now());
  
          EntityManager::persist($reset_password);
          EntityManager::flush();
         //dd($reset_password-&gt;getToken());
  
       Mail::send('email.forgetPassword', ['token'=&gt;$reset_password-&gt;getToken()], function($message) use($request){
              $message-&gt;to($request-&gt;email);
              $message-&gt;subject('Reset Password');
  
          });
  
          return back()-&gt;with('message', 'We have e-mailed your password reset link!');
      }
  
      public function showResetPasswordForm($token) {
          return view('auth.forgetPasswordLink', ['token' =&gt; $token]);
      }
  
  
      public function submitResetPasswordForm(SubmitResetPasswordRequest $request)
      {
          $this-&gt;request = $request-&gt;validated();
         //dd($request-&gt;validated());
         $resetPasswordRepository = EntityManager::getRepository(ResetPassword::class);
        // dd($resetPasswordRepository);
          $resetPassword =$resetPasswordRepository-&gt;findOneBy(['token' =&gt; $request-&gt;token]);
        //  dd($resetPassword);
  
         // $user = $repository-&gt;update(['password' =&gt; Hash::make($request-&gt;password)]);
         // $user = EntityManager::find(User::class, $userId);
  
  
         // EntityManager::flush();
          DB::table('reset_passwords')-&gt;where(['email'=&gt; $request-&gt;email])-&gt;delete();
  
          return redirect('/login')-&gt;with('message', 'Your password has been changed!');
      }
  </code></pre>
  <p>in  ResetPassword entity:</p>
  <pre><code>&lt;?php
  
  namespace App\Models;
  
  use Carbon\Carbon;
  use Doctrine\Common\Collections\ArrayCollection;
  use Doctrine\ORM\Mapping as ORM;
  use Faker\Provider\DateTime;
  use Illuminate\Support\Str;
  
  /**
   * ResetPassword entity
   * @ORM\Entity
   * @ORM\Table(name=&quot;reset_passwords&quot;)
   */
  class ResetPassword
  {
  
      /**
       * @ORM\Id
       * @ORM\Column(type=&quot;integer&quot;, length=11)
       * @ORM\GeneratedValue
       */
      protected $id;
      /**
       * @ORM\Column(type=&quot;string&quot;, unique=true)
       */
      protected $email;
  
      /**
       * @ORM\Column(type=&quot;string&quot;)
       */
      protected $token;
      /**
       * @ORM\Column(type=&quot;datetime&quot;)
       * @var DateTime|null
       */
  
      protected $created_at;
  
      //GettersSetters
      use GetterSetter;
  
      /**
       * @param mixed $email
       */
      public function setEmail($email)
      {
          $this-&gt;email = $email;
      }
  
      /**
       * @return mixed
       */
      public function getEmail()
      {
          return $this-&gt;email;
      }
  
      /**
       * @param mixed $token
       */
      public function setToken($token)
      {
          $this-&gt;token = $token;
  
      }
  
      /**
       * @return mixed
       */
      public function getToken()
      {
          return $this-&gt;token;
  
      }
  
      /**
       * Set date.
       *
       * @param \DateTime $created_at
       *
       * @return
       */
      public function setCreated_at($created_at)
      {
          $this-&gt;created_at = Carbon::now();
  
          return $this;
      }
  
      /**
       * Get date.
       *
       * @return DateTime|null
       */
      public function getCreated_at()
      {
          return $this-&gt;created_at;
      }
  
      public function __construct()
      {
  
      }
  
  }
  </code></pre>