ekmungai / eloquent-ifrs

Eloquent Double Entry Accounting with a focus on IFRS Compliant Reporting
MIT License
335 stars 68 forks source link

Class '\App\User' not found #18

Closed AEK-BKF closed 2 years ago

AEK-BKF commented 4 years ago

Hi, I get this error when I configured User Model as you mentioned in docs. Class '\App\User' not found

Laravel : 6.x

ekmungai commented 4 years ago

I'd need more details to be able to diagnose the problem. Could you post the entire stack trace?

AEK-BKF commented 4 years ago

Thanks for quick reply, Yes sure, I set up my User Model (in App\User) like in docs :

<?php

use IFRS\Traits\IFRSUser;
use IFRS\Interfaces\Recyclable;
...

class User ... implements Recyclable {
  ...
  use IFRSUser;
  ...
}
...
?>
ekmungai commented 4 years ago

That seems okay, where do you get the error? when you run the tests? Have you also gone through the example on the README?

AEK-BKF commented 4 years ago

The errors appears when I implement the User model from Recyclable, If I remove it, it works fine !

ekmungai commented 4 years ago

Huh, thats rather perculiar

jonagoldman commented 4 years ago

@AEK-BKF 1) Is your User model set in IFRS config /config/ifrs.php? 2) Is your User model set in Laravel Auth config /config/auth.php? 3) Is your User model Authenticatable ?

https://github.com/ekmungai/eloquent-ifrs/blob/94517327d3c0331facdc68526e93c44c69954120/src/User.php#L11

AEK-BKF commented 4 years ago

@jonagoldman

  1. Yes
  2. Yes
  3. Yes
AEK-BKF commented 4 years ago

Okey I fiexd it by: -> Adding SoftDeletes to User Model, make migration to add the field. -> Adding Recycling Trait also.

The doc needs improvement.

Thanks