{"id":19423250,"url":"https://github.com/atomjoy/webi","last_synced_at":"2026-05-14T18:04:48.835Z","repository":{"id":58132957,"uuid":"530159290","full_name":"atomjoy/webi","owner":"atomjoy","description":"Logowanie użytkownika json rest api w Laravel. Uwierzytelnianie użytkowników w Laravel REST API.","archived":false,"fork":false,"pushed_at":"2023-07-02T08:17:00.000Z","size":126,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T04:36:33.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://atomjoy.github.io/webi","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomjoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-08-29T09:55:05.000Z","updated_at":"2023-07-23T17:48:36.000Z","dependencies_parsed_at":"2024-11-10T17:47:29.749Z","dependency_job_id":null,"html_url":"https://github.com/atomjoy/webi","commit_stats":{"total_commits":52,"total_committers":2,"mean_commits":26.0,"dds":"0.019230769230769273","last_synced_commit":"0804a33da81129b78e47e68b0a9dc9988dc27ee6"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomjoy","download_url":"https://codeload.github.com/atomjoy/webi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240603074,"owners_count":19827637,"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":[],"created_at":"2024-11-10T13:37:34.640Z","updated_at":"2025-11-17T18:03:17.773Z","avatar_url":"https://github.com/atomjoy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webi auth library\n\nLaravel web rest api authentication library.\n\n## Install (Laravel 10, Php 8.1)\n\nFirst set your .env variables (mysql, smtp) and then\n\n```sh\ncomposer require atomjoy/webi\n```\n\n## User model\n\n```php\n// app/Models/User.php\n\u003c?php\n\nnamespace App\\Models;\n\nuse Webi\\Models\\WebiUser;\n\nclass User extends WebiUser\n{\n  function __construct(array $attributes = [])\n  {\n    parent::__construct($attributes);\n\n    $this-\u003emergeFillable([\n      // 'mobile', 'website'\n    ]);\n\n    $this-\u003emergeCasts([\n      // 'status' =\u003e StatusEnum::class,\n      // 'email_verified_at' =\u003e 'datetime:Y-m-d H:i:s',\n    ]);\n\n    // $this-\u003ehidden[] = 'secret_hash';\n  }\n\n  protected $dispatchesEvents = [\n    // 'saved' =\u003e UserSaved::class,\n    // 'deleted' =\u003e UserDeleted::class,\n  ];\n}\n```\n\n## Create login page\n\n```php\n// routes/web.php\nRoute::get('/login', function() {\n    return 'My login page'; // return view('vue');\n})-\u003ename('login');\n```\n\n## Create activation page\n\n```php\n// routes/web.php\nuse Webi\\Http\\Controllers\\WebiActivate;\n\n// Create your own activation page for Vue, Laravel\nRoute::get('/activate/{id}/{code}', [YourActivationController::class, 'index'])-\u003emiddleware(['webi-locale']);\n\n// Or for tests use json controller from Webi\\Http\\Controllers\\WebiActivate.php\nRoute::get('/activate/{id}/{code}', [WebiActivate::class, 'index'])-\u003emiddleware(['webi-locale']);\n```\n\n## Copy translations to app lang (for tests only)\n\n```sh\nphp artisan lang:publish\nphp artisan vendor:publish --tag=webi-lang-en --force\nphp artisan vendor:publish --tag=webi-lang-pl --force\n```\n\n## Create db tables\n\n```sh\n# Create tables\nphp artisan migrate\n\n# Refresh tables\nphp artisan migrate:fresh\n\n# Seed data (optional)\nphp artisan db:seed --class=WebiSeeder\n```\n\n## Run application\n\n```sh\nphp artisan serve\n```\n\n## Testing\n\nTests readme file location\n\n```sh\ntests/README.md\n```\n\n## Settings (optional)\n\n### Customize\n\n```sh\n# Edit email blade themes\nphp artisan vendor:publish --tag=webi-email\n\n# Edit lang translations\nphp artisan vendor:publish --tag=webi-lang\n\n# Edit config\nphp artisan vendor:publish --tag=webi-config\n\n# Override config\nphp artisan vendor:publish --tag=webi-config --force\n\n# Add the image logo to your mail\nphp artisan vendor:publish --tag=webi-public\n\n# Provider\nphp artisan vendor:publish --provider=\"Webi\\WebiServiceProvider.php\"\n```\n\n## Tables seeder\n\n```sh\nphp artisan db:seed --class=WebiSeeder\n```\n\n## Update classes\n\n```sh\ncomposer update\n\ncomposer dump-autoload -o\n\ncomposer update --no-dev\n```\n\n## Web API Requests\n\nSend requests as json. Response as json: **{'message', \"user\"}**. For more go to: **src/Http/Requests** and **src\\Http\\Controllers** directories or to routes file **routes/web.php**.\n\n### /web/api/login\n\nMethod: **POST**\n\n```sh\nParams: 'email', 'password', 'remember_me'\nData: {'message', \"user\"}\n```\n\n### /web/api/register\n\nMethod: **POST**\n\n```sh\nParams: 'name', 'email', 'password', 'password_confirmation'\nData: {'message', 'created'}\n```\n\n### /web/api/reset\n\nMethod: **POST**\n\n```sh\nParams: 'email'\nData: {'message'}\n```\n\n### /web/api/activate/{id}/{code}\n\nMethod: **GET**\n\n```sh\nParams: 'id', 'code'\nData: {'message'}\n```\n\n### /web/api/logout\n\nMethod: **GET**\n\n```sh\nParams: without params\nData: {'message'}\n```\n\n### /web/api/locale/{locale}\n\nMethod: **GET**\n\n```sh\nParams: 'locale'\nData: {'message', 'locale'}\n```\n\n### /web/api/csrf\n\nMethod: **GET**\n\n```sh\nParams: without params\nData: {'message', 'counter', 'locale'}\n```\n\n### /web/api/logged\n\nMethod: **GET**\n\n```sh\nParams: without params\nData: {'message', 'locale', \"user\"}\n```\n\n### /web/api/change-password\n\nMethod: **POST** Auth: **true**\n\n```sh\nParams: 'password_current', 'password', 'password_confirmation'\nData: {'message'}\n```\n\n### /web/api/test/user, /web/api/test/worker, /web/api/test/admin\n\nMethod: **GET** Auth: **true**\n\n```sh\nParams: without params\nData: {'message', \"user\", 'ip'}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fwebi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomjoy%2Fwebi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fwebi/lists"}