{"id":33952077,"url":"https://github.com/netcore/module-subscription","last_synced_at":"2026-06-03T19:31:23.148Z","repository":{"id":57025450,"uuid":"111931695","full_name":"netcore/module-subscription","owner":"netcore","description":"Subscription plans","archived":false,"fork":false,"pushed_at":"2018-04-07T20:44:09.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-04T05:17:50.388Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/netcore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-24T15:18:58.000Z","updated_at":"2018-04-07T20:42:35.000Z","dependencies_parsed_at":"2022-08-23T15:00:23.503Z","dependency_job_id":null,"html_url":"https://github.com/netcore/module-subscription","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/netcore/module-subscription","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-subscription","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-subscription/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-subscription/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-subscription/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netcore","download_url":"https://codeload.github.com/netcore/module-subscription/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netcore%2Fmodule-subscription/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27689418,"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","status":"online","status_checked_at":"2025-12-12T02:00:06.775Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-12-12T19:22:04.874Z","updated_at":"2025-12-12T19:22:05.634Z","avatar_url":"https://github.com/netcore.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\nThis module allows you to manage subscription plans and let users to subscribe to plans.\n\n## Pre-installation\n\n**Only use this module if you are using a fully custom payment method. If you use Laravel Cashier, there's support coming for that!**\n\nThis package is part of Netcore CMS ecosystem and is only functional in a project that has the following packages\ninstalled:\n\n1. https://github.com/netcore/netcore\n2. https://github.com/netcore/module-admin\n3. https://github.com/netcore/module-translate\n\n### Installation\n\n* Require this package using composer\n```\ncomposer require netcore/module-subscription\n```\n\n* Publish configuration/migrations\n```\nphp artisan module:publish-config Subscription\nphp artisan module:publish-migration Subscription\nphp artisan migrate\n```\n\n* Configure plans and billing periods in `config/netcore/module-subscription.php` file.\n\n* Seed the configuration to database\n```\nphp artisan module:seed Subscription\n```\n\n* Add `Modules\\Subscription\\Traits\\Subscribable` trait to your `User` model\n\n### Usage\n\n* Subscribe to a plan with price specification\n```\n$plan      = Modules\\Subscription\\Models\\Plan::where('key', 'premium')-\u003efirst();\n$planPrice = $plan-\u003eprices()-\u003einPeriod('monthly')-\u003efirst();\n$user      = App\\User::first();\n$user-\u003esubscribe($planPrice, true);\n/*\n The boolean stands for whether the user has already paid for the subscription or not.\n If a boolean is not provided, it'll be automatically set to false.\n*/\n```\n\n* Get user plan\n```\n$plan = $user-\u003eplan;\n```\n\n* Get user subscription\n```\n$subscription   = $user-\u003esubscription;\n$expirationDate = $subscription-\u003eexpires_at;\n$userHasPaid    = $subscription-\u003eis_paid;\n```\n\n* Cancel subscription\n```\n$user-\u003ecancelSubscription();\n```\n\n* Renew subscription\n```\n$user-\u003erenewSubscription(true);\n// The boolean stands for whether the user has already paid for the subscription or not\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcore%2Fmodule-subscription","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetcore%2Fmodule-subscription","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetcore%2Fmodule-subscription/lists"}