{"id":26253886,"url":"https://github.com/jrseliga/pseudo","last_synced_at":"2025-04-27T02:58:24.876Z","repository":{"id":56942033,"uuid":"74424845","full_name":"jrseliga/pseudo","owner":"jrseliga","description":"True guest user library for Laravel [READ-ONLY]","archived":false,"fork":false,"pushed_at":"2018-06-25T16:29:47.000Z","size":21,"stargazers_count":12,"open_issues_count":1,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-27T02:58:19.319Z","etag":null,"topics":["authentication","authorization","laravel","php"],"latest_commit_sha":null,"homepage":"https://gitlab.com/jrseliga/pseudo","language":"PHP","has_issues":false,"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/jrseliga.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":"2016-11-22T02:12:21.000Z","updated_at":"2025-02-16T04:26:02.000Z","dependencies_parsed_at":"2022-08-21T07:50:23.870Z","dependency_job_id":null,"html_url":"https://github.com/jrseliga/pseudo","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrseliga%2Fpseudo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrseliga%2Fpseudo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrseliga%2Fpseudo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jrseliga%2Fpseudo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jrseliga","download_url":"https://codeload.github.com/jrseliga/pseudo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251080979,"owners_count":21533153,"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":["authentication","authorization","laravel","php"],"created_at":"2025-03-13T18:18:14.079Z","updated_at":"2025-04-27T02:58:24.860Z","avatar_url":"https://github.com/jrseliga.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pseudo\nGuest user library for Laravel\n\nBranch         |         |         |\n------- | ------- | ------- |\nmaster  | [![build status](https://gitlab.com/agilesdesign/pseudo/badges/master/build.svg)](https://gitlab.com/agilesdesign/pseudo/commits/master)   | [![coverage report](https://gitlab.com/agilesdesign/pseudo/badges/master/coverage.svg)](https://gitlab.com/agilesdesign/pseudo/commits/master)\ndev     | [![build status](https://gitlab.com/agilesdesign/pseudo/badges/dev/build.svg)](https://gitlab.com/agilesdesign/pseudo/commits/dev)         | [![coverage report](https://gitlab.com/agilesdesign/pseudo/badges/dev/coverage.svg)](https://gitlab.com/agilesdesign/pseudo/commits/dev)\n\n## Description\npseudo adds the ability for guests permissions within Laravel's authentication functionality.\n\n## Installation\n\n##### Include through composer\n\n`composer require agilesdesign/pseudo`\n\n##### Add to provider list\n\n```php\n'providers' =\u003e [\n    Pseudo\\Providers\\PseudoServiceProvider::class,\n];\n```\n\n## Overview\nComparison to default Laravel behavior\n```php\nAuth::check() // true if User false if Pseudo/Contracts/GuestContract \n```\n\n```php\nAuth::user() // returns instance of Pseudo/Contracts/GuestContract instead of null if no user found\n```\n\n```php\n@can() // no longer automatically fails if not authenticated, allows Gate to be checked\n```\n\n## Configuration\n#### Update Guard Driver(s)\n`config/auth.php`\n\n```php\n'guards' =\u003e [\n    // To use with web guard\n    'web' =\u003e [\n        'driver' =\u003e 'pseudo',\n        'provider' =\u003e 'users',\n    ],\n    \n    // To use with api guard\n    'api' =\u003e [\n        'driver' =\u003e 'pseudo-token',\n        'provider' =\u003e 'users',\n    ],\n],\n```\n\n#### Register Service Provider\n\u003e Manually registering the ServiceProvider is only necessary if your Laravel application is version 5.4.* or before.\n`config/app.php`\n\n```php\n'providers' =\u003e [\n    /*\n     * Package Service Providers...\n     */\n    \\Pseudo\\Providers\\PseudoServiceProvider::class,\n],\n```\n\n## Usage\nAn instance of `Pseudo\\Auth\\Guest` is resolved from Laravel's Service Container when `Pseudo/Contracts/GuestContract` is requested.\n\nThis binding is registered in the supplied ServiceProvider:\n\n```php\npublic function register()\n{\n    $this-\u003eapp-\u003ebind(GuestContract::class, Guest::class);\n}\n```\n\nYou may override this by providing your own `GuestUser` class that implements `Pseudo/Contracts/GuestContract` and rebinding the interface:\n\n```php\nclass GuestUser extends User implements GuestContract\n{\n    //You can override any attribute by using Eloquent Accessors\n    public function getNameAttribute(){\n        return 'Guest User';\n    }\n}\n```\n\n```php\nthis-\u003eapp-\u003ebind(\\Pseudo\\Contracts\\GuestContract::class, \\App\\GuestUser::class);\n```\n\nPolicy checks can still be type-hinted for Laravel's `App\\User` since `Pseudo\\Auth\\Guest` extends it.\n\n##### Example\n```php\nGate::define('create-article', function ($user, $article) {\n    if($user instanceof Pseudo\\Auth\\Guest)\n    {\n      // logic for guest\n    }\n    else\n    {\n      // logic for authenticated\n    }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrseliga%2Fpseudo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjrseliga%2Fpseudo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjrseliga%2Fpseudo/lists"}