PHPackages                             jeroen-g/guestpass - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. jeroen-g/guestpass

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

jeroen-g/guestpass
==================

Flickr-like Guest Pass system for Laravel.

v1.0(8y ago)2151EUPL-1.1PHPPHP ~5.6|~7.0

Since Aug 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Jeroen-G/GuestPass)[ Packagist](https://packagist.org/packages/jeroen-g/guestpass)[ Docs](https://github.com/Jeroen-G/GuestPass)[ RSS](/packages/jeroen-g-guestpass/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

GuestPass for Laravel
=====================

[](#guestpass-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/45b7024ad68bdd0bef0f86ecad83fe01c1d65d1aa328af57fd8109b44e829594/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4a65726f656e2d472f4775657374506173732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/Jeroen-G/GuestPass)[![Build Status](https://camo.githubusercontent.com/7f3e22c340f701c6cad59ce88c79afdbf6057e45234751917e21fbefa213e90a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4a65726f656e2d472f4775657374506173732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Jeroen-G/GuestPass)[![Quality Score](https://camo.githubusercontent.com/1782fe5560f8682c5cf2a2892850cd236ed0dd1222d5dec668a4e8666e980e1d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4a65726f656e2d472f4775657374506173732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Jeroen-G/GuestPass)

Installation
------------

[](#installation)

Via Composer

```
$ composer require jeroen-g/guestpass
```

If you run Laravel 5.5, the service provider and facade are autodiscovered. If not then add them manually:

```
JeroenG\GuestPass\GuestPassServiceProvider::class,
// ...
'GuestPass' => JeroenG\GuestPass\GuestPassFacade::class,
```

Usage
-----

[](#usage)

To use Guest Passes, you will need two models: one that is the owner granting guest access (typically a user) and another that is the object to which access is being granted. In the examples below, a photo is used for this.

### Creating new Guest Passes

[](#creating-new-guest-passes)

Requires the owner and object models.

```
GuestPass::create($user, $photo);
```

Returns true if successfull, false otherwise.

### Retrieving Guest Pass data

[](#retrieving-guest-pass-data)

A Guest Pass contains the following data: `owner_model`, `owner_id`; `object_model`, `object_id`; `key` (unique); `view` (nullable).

#### Getting all keys of the owner

[](#getting-all-keys-of-the-owner)

Requires the owner model.

```
GuestPass::getKeysOf($user);
```

Returns a collection of all Guest Pass keys and their corresponding data is attached as well.

#### Finding a Guest Pass for corresponding owner and object

[](#finding-a-guest-pass-for-corresponding-owner-and-object)

Requires the owner and object model.

```
GuestPass::findGuestPass($user, $photo);
```

Returns an Eloquent model (or throws an exception).

#### Get one specific Guest Pass by its key

[](#get-one-specific-guest-pass-by-its-key)

Requires the key (string).

```
GuestPass::getGuestPass($key);
```

Returns an Eloquent model (or throws an exception).

### Checking ownership

[](#checking-ownership)

Requires the owner and Guest Pass models.

```
GuestPass::isOwner($user, $guestpass);
```

Returns true or false.

### Access controller

[](#access-controller)

The package ships with a controller that checks for the `/gp/{owner id}/{key}` route and when valid it returns the view (404 otherwise). Each view is passed the object and the Guest Pass models. The views will be sought in the `resources/views/guests/` directory.

### Custom views

[](#custom-views)

When creating a Guest Pass it is possible to pass a custom view as the third parameter

```
GuestPass::create($user, $photo, 'album');
```

In this case, the access controller will not use `photo.blade.php` (which would be the default) but `album.blade.php` but the directory remains the same and it is not necessary to add the file extension.

Changelog
---------

[](#changelog)

Please see [changelog.md](changelog.md) for what has changed recently.

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details.

Credits
-------

[](#credits)

- [JeroenG](https://github.com/:author_username)
- [All Contributors](../../contributors)

License
-------

[](#license)

The EU Public License. Please see [license.md](license.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3191d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d8700d69abe733de151f8cf49084e99ded7b9d34d7b0d1cd8f3825f5d925ff3?d=identicon)[JeroenG](/maintainers/JeroenG)

---

Top Contributors

[![Jeroen-G](https://avatars.githubusercontent.com/u/1116853?v=4)](https://github.com/Jeroen-G "Jeroen-G (6 commits)")[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (1 commits)")

---

Tags

guestguestpasslaravelJeroenGguestpassGuest Pass

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jeroen-g-guestpass/health.svg)

```
[![Health](https://phpackages.com/badges/jeroen-g-guestpass/health.svg)](https://phpackages.com/packages/jeroen-g-guestpass)
```

###  Alternatives

[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[yajra/laravel-acl

Laravel ACL is a simple role, permission ACL for Laravel Framework.

112103.9k1](/packages/yajra-laravel-acl)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
