{"id":28546437,"url":"https://github.com/akaunting/signed-url","last_synced_at":"2025-07-07T06:31:22.255Z","repository":{"id":56943239,"uuid":"152607812","full_name":"akaunting/signed-url","owner":"akaunting","description":"Signed (unique) URL package for Laravel","archived":false,"fork":false,"pushed_at":"2020-02-20T08:06:02.000Z","size":19,"stargazers_count":17,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-30T05:58:55.562Z","etag":null,"topics":["laravel","php","security","signed","unique","url"],"latest_commit_sha":null,"homepage":"https://akaunting.com","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akaunting.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-11T14:45:24.000Z","updated_at":"2025-02-12T19:03:34.000Z","dependencies_parsed_at":"2022-08-21T02:10:21.926Z","dependency_job_id":null,"html_url":"https://github.com/akaunting/signed-url","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/akaunting/signed-url","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaunting%2Fsigned-url","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaunting%2Fsigned-url/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaunting%2Fsigned-url/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaunting%2Fsigned-url/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akaunting","download_url":"https://codeload.github.com/akaunting/signed-url/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akaunting%2Fsigned-url/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264027562,"owners_count":23546098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","security","signed","unique","url"],"created_at":"2025-06-09T23:39:29.983Z","updated_at":"2025-07-07T06:31:22.250Z","avatar_url":"https://github.com/akaunting.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Signed (unique) URL package for Laravel.\n\n[![Version](https://poser.pugx.org/akaunting/signed-url/v/stable.svg)](https://github.com/akaunting/signed-url/releases)\n[![StyleCI](https://styleci.io/repos/102290249/shield?style=flat\u0026branch=master)](https://styleci.io/repos/102290249)\n[![Downloads](https://poser.pugx.org/akaunting/signed-url/d/total.svg)](https://github.com/akaunting/signed-url)\n[![License](https://poser.pugx.org/akaunting/signed-url/license.svg)](LICENSE.md)\n\nThis package can create URLs with a limited lifetime. This is done by adding an expiration date and a signature to the URL.\n\nThis is how you can create signed URL that's valid for 30 days:\n\n```php\nSignedUrl::sign('https://myapp.com/protected-route', 30);\n```\n\nThe output will look like this:\n\n```\nhttps://app.com/protected-route?expires=xxxxxx\u0026signature=xxxxxx\n```\n\nThe URL can be validated with the `validate`-function.\n\n```php\nSignedUrl::validate('https://app.com/protected-route?expires=xxxxxx\u0026signature=xxxxxx');\n```\n\nThe package also provides [a middleware to protect routes](https://github.com/akaunting/signed-url#protecting-routes-with-middleware).\n\n## Installation\n\nAs you would have guessed the package can be installed via Composer:\n\n```\ncomposer require akaunting/signed-url\n```\n\nThis package intends to provide tools for formatting and conversion monetary values in an easy, yet powerful way for Laravel projects. In older versions of the framework, just add the serviceprovider, and optionally register the facade:\n\n```php\n// config/app.php\n\n'providers' =\u003e [\n    ...\n    Akaunting\\SignedUrl\\Provider::class,\n];\n\n'aliases' =\u003e [\n    ...\n    'SignedUrl' =\u003e Akaunting\\SignedUrl\\Facade::class,\n];\n```\n\n## Configuration\n\nThe configuration file can optionally be published via:\n\n```\nphp artisan vendor:publish --provider=signed-url\n```\n\nThis is the content of the file:\n\n```php\nreturn [\n\n    /*\n    * This string is used the to generate a signature. You should\n    * keep this value secret.\n    */\n    'signatureKey' =\u003e env('APP_KEY'),\n\n    /*\n     * The default expiration time of a URL in days.\n     */\n    'default_expiration_time_in_days' =\u003e 1,\n\n    /*\n     * These strings are used a parameter names in a signed url.\n     */\n    'parameters' =\u003e [\n        'expires' =\u003e 'expires',\n        'signature' =\u003e 'signature',\n    ],\n\n    /*\n    |--------------------------------------------------------------------------\n    | Middleware\n    |--------------------------------------------------------------------------\n    |\n    | This option indicates the middleware to change language.\n    |\n    */\n    'middleware'    =\u003e 'Akaunting\\SignedUrl\\Middleware\\ValidateSignedUrl',\n\n];\n```\n## Usage\n\n### Signing URLs\nURL's can be signed with the `sign`-method:\n```php\nSignedUrl::sign('https://myapp.com/protected-route');\n```\nBy default the lifetime of an URL is one day. This value can be change in the config-file.\nIf you want a custom life time, you can specify the number of days the URL should be valid:\n\n```php\n//the generated URL will be valid for 5 days.\nSignedUrl::sign('https://myapp.com/protected-route', 5);\n```\n\nFor fine grained control, you may also pass a `DateTime` instance as the second parameter. The url\nwill be valid up to that moment. This example uses Carbon for convenience:\n```php\n//This URL will be valid up until 2 hours from the moment it was generated.\nSignedUrl::sign('https://myapp.com/protected-route', Carbon\\Carbon::now()-\u003eaddHours(2) );\n```\n\n### Validating URLs\nTo validate a signed URL, simply call the `validate()`-method. This return a boolean.\n```php\nSignedUrl::validate('https://app.com/protected-route?expires=xxxxxx\u0026signature=xxxxxx');\n```\n\n### Protecting routes with middleware\nThe package also provides a middleware to protect routes:\n\n```php\nRoute::get('protected-route', ['middleware' =\u003e 'signed', function () {\n    return 'Hello secret world!';\n}]);\n```\nYour app will abort with a 403 status code if the route is called without a valid signature.\n\n\n## Changelog\n\nPlease see [Releases](../../releases) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n## Security\n\nIf you discover any security related issues, please email security@akaunting.com instead of using the issue tracker.\n\n## Credits\n\n- [Cüneyt Şentürk](https://github.com/cuneytsenturk)\n- [Sebastian De Deyne](https://github.com/sebastiandedeyne)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakaunting%2Fsigned-url","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakaunting%2Fsigned-url","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakaunting%2Fsigned-url/lists"}