{"id":41798591,"url":"https://github.com/aliirfaan/laravel-simple-force-update","last_synced_at":"2026-01-25T05:34:04.936Z","repository":{"id":56945660,"uuid":"398174514","full_name":"aliirfaan/laravel-simple-force-update","owner":"aliirfaan","description":"Very often we want clients, especially mobile applications to update to the latest version. To enable force update feature, we need to keep release versions in our database and compare with the version of the device. This package creates a table to keep releases and provides a service to suggest actions based on version comparison.","archived":false,"fork":false,"pushed_at":"2021-10-01T07:01:40.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-17T18:33:15.387Z","etag":null,"topics":["force-update","laravel","semantic-versioning"],"latest_commit_sha":null,"homepage":"","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/aliirfaan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-20T06:13:18.000Z","updated_at":"2023-10-16T19:46:34.000Z","dependencies_parsed_at":"2022-08-21T02:40:19.677Z","dependency_job_id":null,"html_url":"https://github.com/aliirfaan/laravel-simple-force-update","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/aliirfaan/laravel-simple-force-update","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliirfaan%2Flaravel-simple-force-update","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliirfaan%2Flaravel-simple-force-update/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliirfaan%2Flaravel-simple-force-update/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliirfaan%2Flaravel-simple-force-update/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliirfaan","download_url":"https://codeload.github.com/aliirfaan/laravel-simple-force-update/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliirfaan%2Flaravel-simple-force-update/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28744429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T05:12:38.112Z","status":"ssl_error","status_checked_at":"2026-01-25T05:04:50.338Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["force-update","laravel","semantic-versioning"],"created_at":"2026-01-25T05:34:04.223Z","updated_at":"2026-01-25T05:34:04.930Z","avatar_url":"https://github.com/aliirfaan.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Simple Force Update\n\nVery often we want clients, especially mobile applications to update to the latest version. To enable force update feature, we need to keep release versions in our database and compare with the version of the device. This package creates a table to keep releases and provides a service to suggest actions based on version comparison.\n\n## Features\n\n* Table structure to keep versions with support for multiple applications and platforms\n* Uses semantic versioning format to keep versions\n* Provides interface so that you can implement your own force update logic\n* Throws custom exception when invalid semantic string is encountered\n\n## Default force update logic\n* candidate version == max version ||  candidate version \u003e max version : No action\n* candidate version \u003c max version \u0026\u0026 candidate version \u003e min version : Action: update available\n* candidate version \u003c min version : Action: update required / force update\n* candidate version == min version : Action: update available\n\n## Requirements\n\n* [Composer](https://getcomposer.org/)\n* [Laravel](http://laravel.com/)\n* [naneau/semver](https://github.com/naneau/semver)\n\n## Installation\n\nYou can install this package on an existing Laravel project with using composer:\n\n```bash\n $ composer require aliirfaan/laravel-simple-force-update\n```\n\nRegister the ServiceProvider by editing **config/app.php** file and adding to providers array:\n\n```php\n  aliirfaan\\LaravelSimpleForceUpdate\\SimpleForceUpdateProvider::class,\n```\n\nNote: use the following for Laravel \u003c5.1 versions:\n\n```php\n 'aliirfaan\\LaravelSimpleForceUpdate\\SimpleForceUpdateProvider',\n```\n\nPublish files with:\n\n```bash\n $ php artisan vendor:publish --provider=\"aliirfaan\\LaravelSimpleForceUpdate\\SimpleForceUpdateProvider\"\n```\n\nor by using only `php artisan vendor:publish` and select the `aliirfaan\\LaravelSimpleForceUpdate\\SimpleForceUpdateProvider` from the outputted list.\n\nApply the migrations:\n\n```bash\n $ php artisan migrate\n ```\n\n## Usage\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Http\\Request;\nuse aliirfaan\\LaravelSimpleForceUpdate\\Services\\SimpleForceUpdateService;\n\nclass TestController extends Controller\n{\n    public function index(Request $request, SimpleForceUpdateService $simpleForceUpdateService)\n    {\n        // get all versions by application. You may have multiple applications/mobile apps\n        $appName = 'default';\n        $platform = null;\n\n        $result = $simpleForceUpdateService-\u003egetVersions($appName, $platform);\n        dd($result);\n\n        // get version by application and platform.\n        $appName = 'default';\n        $platform = 'android';\n\n        $result = $simpleForceUpdateService-\u003egetVersions($appName, $platform);\n        dd($result);\n\n        // get update action based on a candidate version.\n        $candidateVersion = '2.0.9'; // this is normally the version currently installed on the client/device\n        $appName = 'default';\n        $platform = 'android';\n\n        $result = $simpleForceUpdateService-\u003egetApplicationCompatibility($candidateVersion, $appName, $platform);\n        dd($result);\n\n    }\n}\n```\n\n## Implement your own force update logic\n\nTo implement your own force update logic, create a class that extends the **aliirfaan\\LaravelSimpleForceUpdate\\Contracts\\AbstractSimpleForceUpdate** class\n\n```php\n\u003c?php\n\nnamespace App\\Services;\n\nuse aliirfaan\\LaravelSimpleForceUpdate\\Contracts\\AbstractSimpleForceUpdate;\n\nclass CustomForceUpdateService extends AbstractSimpleForceUpdate \n{\n    /**\n     * You can override this function or create another function\n     */\n    public function getApplicationCompatibility($candidateVersion, $appName = 'default', $platform = 'android')\n    {\n        // your logic\n    }\n}\n```\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2020\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliirfaan%2Flaravel-simple-force-update","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliirfaan%2Flaravel-simple-force-update","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliirfaan%2Flaravel-simple-force-update/lists"}