mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-15 23:54:04 +00:00
[3.x] Use static properties instead of config for features (#391)
* Use static properites instead of config for features * update tests
This commit is contained in:
parent
3bb2759fe2
commit
c2c90ff755
4 changed files with 14 additions and 13 deletions
|
|
@ -15,6 +15,8 @@ class Timestamps implements Feature
|
|||
/** @var Repository */
|
||||
protected $config;
|
||||
|
||||
public static $format = 'c'; // ISO 8601
|
||||
|
||||
public function __construct(Repository $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
|
|
@ -38,9 +40,6 @@ class Timestamps implements Feature
|
|||
|
||||
public function now(): string
|
||||
{
|
||||
// Add this key to your tenancy.php config if you need to change the format.
|
||||
return Date::now()->format(
|
||||
$this->config->get('tenancy.timestamp_format') ?? 'c' // ISO 8601
|
||||
);
|
||||
return Date::now()->format(static::$format);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue