App\Repositories\Repository::find PHP Method

find() public method

public find ( $id ) : mixed
$id
return mixed
    public function find($id)
    {
        return $this->query()->find($id);
    }

Usage Example

 /**
  * @param $input
  * @return mixed
  * @throws GeneralException
  */
 public function changePassword($input)
 {
     $user = parent::find(access()->id());
     if (Hash::check($input['old_password'], $user->password)) {
         $user->password = bcrypt($input['password']);
         return parent::save($user);
     }
     throw new GeneralException(trans('exceptions.frontend.auth.password.change_mismatch'));
 }