mabo/snowflake

Snowflake - A Discord snowflake converter.

1.0.0 2021-05-05 20:52 UTC

This package is auto-updated.

Last update: 2024-05-07 14:12:19 UTC


README

Discord Snowflake Laravel Package

Requirement

  1. PHP >= 7.0
  2. Composer

Installation

$ composer require mabo/snowflake

Useage

  1. Add SnowflakeServiceProvider to your config/app.php
MaBo\Snowflake\SnowflakeServiceProvider::class
  1. Publish the provider
php artisan vendor:publish --provider="MaBo\Snowflake\SnowflakeServiceProvider" --tag="config"
  1. 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
];

?>
  1. 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