Download the PHP package vimatech/laravel-invitation without Composer

On this page you can find all versions of the php package vimatech/laravel-invitation. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-invitation

Laravel Invitations

Email invitations to any Eloquent model

CI Latest Version on Packagist Total Downloads License

Generic email-based invitations for Laravel. Invite anyone to join, access, or accept an action related to any Eloquent model: Organization, Team, Project, Workspace, Document, and more.

Why Laravel Invitation?

Quick Start

Subject: The model being invited to (Project, Team, Organization, Workspace, etc.). Set via ->for($model). An invitation without a subject is a "global" invitation.

Requirements

Installation

The Packagist name is singular (vimatech/laravel-invitation) while the repository is plural. The published name cannot change without breaking existing installs, so it stays as it is: install the singular, read the plural.

Publish the configuration file (optional)

Publish and run migrations

Publish views (optional)

Usage

Basic invitation

Invitation to a User model

If you already have the user model, you can pass it directly, the email will be extracted automatically:

Invitation linked to a model

Using the HasInvitations trait

Accepting an invitation

Accepting after registration (new user)

Cancelling an invitation

Declining an invitation (by invitee)

The invitee can actively refuse an invitation:

Resending an invitation

Resend generates a new token and resets the expiration. Only pending or expired invitations can be resent. Accepted and cancelled invitations will throw an exception.

Querying invitations

Metadata

Store any custom data with an invitation:

Expiration

Invitations expire based on the expires_after_days config (default: 7 days). You can also set a custom expiration:

No expiration

For use cases like friend requests where invitations should stay active indefinitely:

Duplicate Policy

By default, sending a second invitation to the same email for the same subject throws an InvitationAlreadyExistsException:

To allow duplicate pending invitations, set this in your config:

Events

The following events are dispatched:

Event When
InvitationCreated Invitation record created
InvitationSent Notification sent
InvitationAccepted Invitation accepted
InvitationDeclined Invitation declined by invitee
InvitationExpired Expired invitation discovered during acceptance
InvitationCancelled Invitation cancelled
InvitationResent Invitation resent with new token

All events contain the $invitation property. InvitationAccepted also contains the $user.

Listening to events

Custom Acceptance Handler

Via callback

Via config

Create a class implementing the AcceptsInvitations contract:

Then set it in config:

Custom Notification

You can customize the invitation email in several ways:

Extend the default notification

Or create a fully custom notification

Your notification will receive the Invitation model and the plain token in its constructor.

Translations

All notification strings use Laravel's __() helper. Add translations via JSON files:

Public Routes

When routes.enabled is true (default), the package registers:

Method URI Name
GET /invitations/{token} invitations.preview
POST /invitations/{token}/accept invitations.accept
POST /invitations/{token}/decline invitations.decline

Configure in config/invitation.php:

Authentication and routes

The preview page (GET) is public: anyone with the link can view the invitation details.

The accept route (POST) does not enforce authentication by default. Two common patterns:

To require authentication, add auth to the route middleware in config:

Database Schema

Token Security

Configuration

Full config options in config/invitation.php:

Exceptions

All exceptions extend InvitationException:

Testing

Contributing

See CONTRIBUTING.md.

Changelog

Please see CHANGELOG.md for recent changes.

Security

If you discover a security vulnerability, please review our security policy. Do not open a public GitHub issue.

Credits

Built and maintained by Vimatech. Created by Adel Zemzemi.

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-invitation with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/contracts Version ^11.0|^12.0|^13.0
illuminate/database Version ^11.0|^12.0|^13.0
illuminate/notifications Version ^11.0|^12.0|^13.0
illuminate/support Version ^11.0|^12.0|^13.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vimatech/laravel-invitation contains the following files

Loading the files please wait ...