{"id":14975379,"url":"https://github.com/mprince2k18/laravel-pointable","last_synced_at":"2025-10-27T13:30:36.894Z","repository":{"id":57020603,"uuid":"343016582","full_name":"mprince2k18/laravel-pointable","owner":"mprince2k18","description":"Point Transaction system for Laravel 8.*","archived":false,"fork":false,"pushed_at":"2021-03-04T07:36:02.000Z","size":23565,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T05:41:18.768Z","etag":null,"topics":["coin-system","laravel","laravel-package","laravel8","php","point","point-system","pointable","wallet"],"latest_commit_sha":null,"homepage":"https://github.com/mprince2k18/laravel-pointable","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/mprince2k18.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":"2021-02-28T04:02:41.000Z","updated_at":"2022-09-30T13:51:12.000Z","dependencies_parsed_at":"2022-08-23T12:20:33.504Z","dependency_job_id":null,"html_url":"https://github.com/mprince2k18/laravel-pointable","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprince2k18%2Flaravel-pointable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprince2k18%2Flaravel-pointable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprince2k18%2Flaravel-pointable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mprince2k18%2Flaravel-pointable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mprince2k18","download_url":"https://codeload.github.com/mprince2k18/laravel-pointable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238497680,"owners_count":19482296,"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":["coin-system","laravel","laravel-package","laravel8","php","point","point-system","pointable","wallet"],"created_at":"2024-09-24T13:51:57.008Z","updated_at":"2025-10-27T13:30:36.438Z","avatar_url":"https://github.com/mprince2k18.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/mprince/laravel-pointable/v/stable)](https://packagist.org/packages/mprince/laravel-pointable)\n[![Total Downloads](https://poser.pugx.org/mprince/laravel-pointable/downloads)](https://packagist.org/packages/mprince/laravel-pointable)\n[![Latest Unstable Version](https://poser.pugx.org/mprince/laravel-pointable/v/unstable)](https://packagist.org/packages/mprince/laravel-pointable) \n[![License](https://poser.pugx.org/mprince/laravel-pointable/license)](https://packagist.org/packages/mprince/laravel-pointable)\n\n# Laravel Pointable\n\nPoint Transaction system for Laravel 8.*\n\nInspired from [Trexology](https://github.com/Trexology/laravel-pointable)\n\n## Installation\n\nFirst, pull in the package through Composer.\n\n## For Laravel 8\n\n```js\ncomposer require mprince/laravel-pointable\n```\n\n## For Laravel 7\n\n```js\ncomposer require mprince/laravel7-pointable\n```\n\nAnd then include the service provider within `app/config/app.php`.\n\n```php\n'providers' =\u003e [\n    Mprince\\Pointable\\PointableServiceProvider::class\n];\n```\n\nAt last you need to publish.\n```\nphp artisan vendor:publish --provider=\"Mprince\\Pointable\\PointableServiceProvider\"\n```\n\nand then run the migration.\n\n```\nphp artisan migrate\n```\n\n-----\n\n### Setup a Model\n```php\n\u003c?php\n\nnamespace App;\n\nuse Mprince\\Pointable\\Contracts\\Pointable;\nuse Mprince\\Pointable\\Traits\\Pointable as PointableTrait;\nuse Illuminate\\Database\\Eloquent\\Model;\n\nclass User extends Model implements Pointable\n{\n    use PointableTrait;\n}\n```\n\n### Add Points\n```php\n$user = User::first();\n$amount = 10; // (Double) Can be a negative value\n$message = \"The reason for this transaction\";\n\n//Optional (if you modify the point_transaction table)\n$data = [\n    'ref_id' =\u003e 'someReferId',\n];\n\n$transaction = $user-\u003eaddPoints($amount,$message,$data);\n\ndd($transaction);\n```\n\n### Subtract Points\n```php\n$user = User::first();\n$amount = 10; // (Double) Can be a negative value\n$message = \"The reason for this transaction\";\n\n//Optional (if you modify the point_transaction table)\n$data = [\n    'ref_id' =\u003e 'someReferId',\n];\n\n$transaction = $user-\u003esubPoints($amount,$message,$data);\n\ndd($transaction);\n```\n\n### Get Current Points\n```php\n$user = User::first();\n$points = $user-\u003ecurrentPoints();\n\ndd($points);\n```\n\n### Get Transactions\n```php\n$user = User::first();\n$user-\u003etransactions;\n\n//OR\n$user['transactions'] = $user-\u003etransactions(2)-\u003eget(); //Get last 2 transactions\n\ndd($user);\n```\n\n### Count Transactions\n```php\n$user = User::first();\n$user['transactions_total'] = $user-\u003ecountTransactions();\n\ndd($user);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmprince2k18%2Flaravel-pointable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmprince2k18%2Flaravel-pointable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmprince2k18%2Flaravel-pointable/lists"}