{"id":19423267,"url":"https://github.com/atomjoy/webi-mini","last_synced_at":"2026-05-12T20:08:19.241Z","repository":{"id":112343773,"uuid":"609841416","full_name":"atomjoy/webi-mini","owner":"atomjoy","description":"Laravel rest api authentication with csrf and session cookies without roles.","archived":false,"fork":false,"pushed_at":"2023-03-05T12:09:31.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T18:53:42.125Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/atomjoy/webi-mini","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":"2023-03-05T12:05:13.000Z","updated_at":"2023-07-23T17:50:08.000Z","dependencies_parsed_at":"2023-05-13T08:45:08.605Z","dependency_job_id":null,"html_url":"https://github.com/atomjoy/webi-mini","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/atomjoy%2Fwebi-mini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi-mini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi-mini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fwebi-mini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomjoy","download_url":"https://codeload.github.com/atomjoy/webi-mini/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240603062,"owners_count":19827635,"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":["laravel-auth","laravel-authentication"],"created_at":"2024-11-10T13:37:39.310Z","updated_at":"2026-05-12T20:08:14.213Z","avatar_url":"https://github.com/atomjoy.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webi auth library\n\nLaravel rest api authentication.\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-mini\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      // 'role' =\u003e UserRole::class,\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-mini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomjoy%2Fwebi-mini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fwebi-mini/lists"}