mabo / snowflake
Snowflake - A Discord snowflake converter.
1.0.0
2021-05-05 20:52 UTC
Requires
- php: ~7.0
Requires (Dev)
- phpunit/phpunit: >=7.0
This package is auto-updated.
Last update: 2024-05-07 14:12:19 UTC
README
Discord Snowflake Laravel Package
Requirement
- PHP >= 7.0
- Composer
Installation
$ composer require mabo/snowflake
Useage
- Add SnowflakeServiceProvider to your config/app.php
MaBo\Snowflake\SnowflakeServiceProvider::class
- Publish the provider
php artisan vendor:publish --provider="MaBo\Snowflake\SnowflakeServiceProvider" --tag="config"
- Goto config/snowflake.php and change the settings
<?php
return [
"format" => "d-m-Y | H:i:s",
"timezone" => "Europe/Berlin" // List of supported timezones https://www.php.net/manual/en/timezones.php
];
?>
- add snowflake to your project
use MaBo\Snowflake\Snowflake;
Snowflake::resolve($discordID);
// Example: Snowflake::resolve("129749996458344449")
// returns 25-12-2015 | 02:00:10
License
MIT