Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
<?php

namespace Modules\Core\Entities;

use Illuminate\Auth\Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Modules\Core\Contracts\JWTSubject;

/**
 * Modules\Core\Entities\ApiToken
 *
 * @property integer $id
 * @property string $token
 * @property string $payload
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @property string $deleted_at
 * @method static \Illuminate\Database\Query\Builder|\Modules\Core\Entities\ApiToken whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\Modules\Core\Entities\ApiToken whereToken($value)
 * @method static \Illuminate\Database\Query\Builder|\Modules\Core\Entities\ApiToken wherePayload($value)
 * @method static \Illuminate\Database\Query\Builder|\Modules\Core\Entities\ApiToken whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\Modules\Core\Entities\ApiToken whereUpdatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\Modules\Core\Entities\ApiToken whereDeletedAt($value)
 * @mixin \Eloquent
 */
class ApiToken extends Model implements AuthenticatableContract, JWTSubject
{
    use SoftDeletes, Authenticatable;
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'api_tokens';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = ['payload', 'token'];

    /**
     * @return mixed
     */
    public function getJWTIdentifier()
    {
        return $this->getKey(); // Eloquent model method
    }

    /**
     * @return array
     */
    public function getJWTCustomClaims()
    {
        return [];
    }

    /**
     * Get the password for the user.
     *
     * @return string
     */
    public function getAuthPassword()
    {
        return $this->token;
    }
}