{"id":24763884,"url":"https://github.com/fadhil-riyanto/noauth-laravel","last_synced_at":"2025-03-23T15:18:13.196Z","repository":{"id":273688894,"uuid":"920389244","full_name":"fadhil-riyanto/noauth-laravel","owner":"fadhil-riyanto","description":"Static auth library without database for Laravel 11.x, good for single user App","archived":false,"fork":false,"pushed_at":"2025-02-21T06:42:42.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-21T07:29:16.776Z","etag":null,"topics":["auth","authentication","laravel","without-db"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/fadhil_riyanto/noauth-laravel","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fadhil-riyanto.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-22T04:06:40.000Z","updated_at":"2025-02-21T06:42:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"d2106da6-6b10-456f-90c4-133f3288056f","html_url":"https://github.com/fadhil-riyanto/noauth-laravel","commit_stats":null,"previous_names":["fadhil-riyanto/noauth-laravel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhil-riyanto%2Fnoauth-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhil-riyanto%2Fnoauth-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhil-riyanto%2Fnoauth-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fadhil-riyanto%2Fnoauth-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fadhil-riyanto","download_url":"https://codeload.github.com/fadhil-riyanto/noauth-laravel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245119591,"owners_count":20563764,"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":["auth","authentication","laravel","without-db"],"created_at":"2025-01-28T21:20:31.099Z","updated_at":"2025-03-23T15:18:13.189Z","avatar_url":"https://github.com/fadhil-riyanto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## NoAuth Laravel\n\nis a non-database authentication that keeps authentication as small as possible. good for single-user APP\n\n## Setup\n\n\ncreate your password list inside .env with comma-separated string\n\n```env\nNOAUTH_PASSWORD=\"abc123,foobar123,otherxyz\"\n```\n\nfirst, use the namespace\n\n```php\nuse FadhilRiyanto\\NoAuthLaravel\\NoAuth;\n```\n\ndefining routes for guest which try access route with `NoAuthMiddleware` class, the route must be named as 'noauth-guest', example\n\n```php\n// guest will redireced here\nRoute::get('login', function() {\n        return view('admin/login');\n})-\u003ename(\"noauth-guest\");\n```\n\ndefine admin route with middleware, example\n\n```php\n// protect admin page using middleware NoAuthMiddleware\nRoute::get('home', [Controllers\\AdminController::class, 'handle_admin_homepage'])\n                -\u003emiddleware(NoAuthMiddleware::class);\n```\n\nauthentication example, `NoAuth::attemp` is automatically create a session if successful and return false otherwise\n\n```php\nclass AdminController extends Controller\n{\n        public function handle_admin_login_ajax(Request $request)\n        {\n                $validator = Validator::make($request-\u003eall(), [\n                        'password' =\u003e 'required',\n                ]);\n\n                $validated = $validator-\u003evalidated();\n\n                if (NoAuth::attemp($request)) {\n                        return response()-\u003ejson([\"message\" =\u003e \"Welcome\"], 200);\n                } else {\n                        return response()-\u003ejson([\"message\" =\u003e \"The provided credentials do not match our records\"], 400);\n                }\n        }\n}\n\n```\n\n### Maintainer: \n[Fadhil-Riyanto](https://github.com/fadhil-riyanto)\n## License\nGPL-2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadhil-riyanto%2Fnoauth-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffadhil-riyanto%2Fnoauth-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffadhil-riyanto%2Fnoauth-laravel/lists"}