Hi,
i have tried use the guide
quick-start.md
version in composer: "tymon/jwt-auth": "0.5.*"
`
namespace App\Models;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\AuthUser as Authenticatable;
use App\Models\Project;
class User extends Authenticatable implements JWTSubject
{
use Notifiable;
/**
* Get the identifier that will be stored in the subject claim of the JWT.
*
* @return mixed
*/
public function getJWTIdentifier()
{
return $this->getKey();
}
/**
* Return a key value array, containing any custom claims to be added to the JWT.
*
* @return array
*/
public function getJWTCustomClaims()
{
return [];
}
/**
* Questi attributi possono essere modificati
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* Questi attributi non potranno essere visti nella chiamata rest
*
* @var array
*/
protected $hidden = [
'password', 'remember_token'
];
/**
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function projects(){
$propertyInProject="user_id";
$propertyForeignWithProject="id";
return $this->hasMany(Project::class,$propertyInProject,$propertyForeignWithProject);
}
}
`
before use the guide the model worked fine (i retrived always the token).
(1/1)聽FatalErrorExceptionInterface 'Tymon\JWTAuth\Contracts\JWTSubject' not found
in聽User.php聽(line 12)
looks like you are looking at the docs for version 1.0.0 instead of 0.5.*.. You will either need to update to 1.0.0 or see the wiki for 0.5 docs
/**
/**
/**
/**
Most helpful comment
looks like you are looking at the docs for version
1.0.0instead of0.5.*.. You will either need to update to1.0.0or see the wiki for0.5docs