namespace AppModels;
use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateDatabaseEloquentModel;
class Person extends Model
{
private static $token = 'PWPu3Wl71N39x3M';
public static function getToken() {
return self::token;
}
}
如何获得token?
$token = 'PWPu3Wl71N39x3M';namespace AppModels;
use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateDatabaseEloquentModel;
class Person extends Model
{
/** @var string */
private const TOKEN = 'text';
/**
* @return string
*/
public static function getToken(): string
{
return self::TOKEN; // text
}
}
/**
* Usage
*/
Person::getToken(); // text