Download the PHP package hasinhayder/tyro without Composer

On this page you can find all versions of the php package hasinhayder/tyro. 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 tyro

Tyro

Packagist Downloads Tests Laravel Laravel PHP

Tyro is the complete authentication, roles & privileges package for Laravel 12 & 13: a modern RBAC/ACL solution built on Laravel Sanctum, with a fantastic CLI that manages everything for you.

Set up in under a minute. No complicated configuration. No boilerplate.

📖 Full documentation

Requirements

Installation (about a minute)

That's it. tyro:install sets up Sanctum, prepares your User model, runs migrations, and seeds the default roles & privileges, including a ready-to-use [email protected] superuser (password: tyro).

Want the ready-made API client? Run php artisan tyro:postman to open the official Postman collection.

Quick tour

Checking roles & privileges

Managing roles & privileges

Protecting routes

Route middleware aliases available out of the box:

Middleware Alias Description
role:admin User must possess the specified single role.
roles:admin,editor User must possess any of the comma-separated roles.
privilege:reports.run User must possess the specified single privilege.
privileges:reports.run,billing.view User must possess any of the comma-separated privileges.
tyro.log Log API requests into Tyro's audit trail.

Example route definitions:

Role & Privilege Helpers (HasTyroRoles)

In addition to basic role/privilege checks (hasRole, hasRoles, hasAnyRole, hasPrivilege, hasPrivileges, can), HasTyroRoles includes convenient helper methods:

Suspending users

Auditing admin actions

Every role assignment, privilege change, suspension, and admin action is recorded automatically:

Blade directives

Directive Description
@hasRole('admin') ... @endhasRole Check for a single role
@hasRoles(['admin', 'editor']) ... @endhasRoles Check if user has ALL specified roles
@hasAnyRole(['admin', 'editor']) ... @endhasAnyRole Check if user has ANY specified role
@hasPrivilege('reports.run') ... @endhasPrivilege Check for a single privilege
@hasPrivileges(['reports.run', 'billing.view']) ... @endhasPrivileges Check if user has ALL specified privileges
@hasAnyPrivilege(['reports.run', 'billing.view']) ... @endhasAnyPrivilege Check if user has ANY specified privilege
@userCan('reports.run') ... @enduserCan Check privilege, role, or Laravel Gate

CLI at a glance

One of Tyro's most powerful features: you can manage everything from the CLI (users, roles, privileges, tokens, suspensions, and audit logs) without touching the database directly. Perfect for automation, CI/CD pipelines, and incident response.

Users

Command Description
tyro:user-create Create a new user and attach Tyro's default role
tyro:user-list Display all users tracked by Tyro
tyro:user-list-with-roles Display users alongside their Tyro roles
tyro:user-show Display a single user's details, roles, privileges, and suspension state
tyro:user-update Modify a user's name, email, and password
tyro:user-delete Delete a user while respecting the admin guardrails
tyro:user-suspend Suspend a user (revokes all tokens)
tyro:user-unsuspend Lift the suspension for a user
tyro:user-suspended List every user currently suspended
tyro:user-token Mint a Sanctum token without prompting for credentials
tyro:user-roles Display a user's roles and their attached privileges
tyro:user-privileges Display the privileges inherited by a user

Roles

Command Description
tyro:role-create Create a new role
tyro:role-list Display all Tyro roles
tyro:role-list-with-privileges Display each role along with its attached privileges
tyro:role-update Modify a role name or slug
tyro:role-delete Delete a role (except the protected ones)
tyro:role-attach Attach a role to a user
tyro:role-detach Detach a role from a user
tyro:role-users Display every user assigned to the given role
tyro:role-purge Truncate the roles and pivot tables without re-seeding
tyro:role-clone Clone a role together with all of its privileges
tyro:role-sync Synchronize a role's privileges with another role (supports --remove-extra and --dry-run; protected roles cannot be targets)

Privileges

Command Description
tyro:privilege-create Create a new Tyro privilege record
tyro:privilege-list Display all Tyro privileges and their roles
tyro:privilege-update Modify an existing privilege record
tyro:privilege-delete Delete a Tyro privilege record
tyro:privilege-attach Attach a privilege to a Tyro role
tyro:privilege-detach Detach a privilege from a Tyro role
tyro:privilege-purge Delete every privilege record and detach them from roles

Auth & Tokens

Command Description
tyro:auth-login Mint a Sanctum token for a user via the CLI
tyro:auth-logout Delete a single Sanctum token (log out the corresponding session)
tyro:auth-logout-all Delete every Sanctum token for a specific user
tyro:auth-logout-all-users Revoke every Sanctum token issued for all users
tyro:who Inspect which user a given token belongs to

Audit & Setup

Command Description
tyro:audit-list Display recent Tyro audit logs
tyro:audit-purge Purge old Tyro audit logs
tyro:seed-all Seed default roles, privileges, and bootstrap admin user
tyro:seed-roles Seed default role definitions
tyro:seed-privileges Seed default privilege definitions and role assignments
tyro:user-prepare Add HasApiTokens and HasTyroRoles traits to the default User model
tyro:install Bootstrap Tyro: set up Sanctum, run migrations, seed roles/privileges, and prepare your User model
tyro:publish-config Publish Tyro's configuration file into your application
tyro:publish-migrations Publish Tyro's migration files into your application
tyro:update-config Update tyro config with the latest version
tyro:sys-version Show the currently installed Tyro version
tyro:sys-about Show Tyro's mission, version, and author details
tyro:setup-ai-skill Install the Tyro Authorization AI skill for your preferred agent
tyro:doc Open the Tyro documentation in your browser
tyro:postman Open the Tyro Postman collection in your browser
tyro:star Open the Tyro GitHub repository so you can star it
tyro:run-tests Run your project's automated tests (Pest by default)

Run php artisan list tyro to see every available command. Most commands also have shorter aliases (for example, tyro:login, tyro:users, tyro:roles, tyro:me, tyro:audit).

Optional: REST API

Tyro ships REST endpoints for auth, user management, and role/privilege CRUD (enabled by default, prefix api). Disable them whenever you want:

Configuration

Publish and customize everything:

If you want to update your published configuration later when new options are introduced, you can run:

Every option in config/tyro.php

API & routes

Env var Default Description
TYRO_DISABLE_API false Skip loading Tyro's REST routes entirely
TYRO_DISABLE_COMMANDS false Skip registering Tyro's artisan commands
TYRO_GUARD sanctum Guard used by Tyro's protected routes
TYRO_ROUTE_PREFIX api Prefix for Tyro's REST routes
TYRO_ROUTE_NAME_PREFIX tyro. Prefix for Tyro's route names

Users & roles

Env var Default Description
TYRO_USER_MODEL, AUTH_MODEL App\Models\User User model Tyro operates on
DEFAULT_ROLE_SLUG user Role slug attached to newly registered users
TYRO_USERS_TABLE users Table name used for suspension columns

Passwords

Env var Default Description
TYRO_PASSWORD_MIN_LENGTH 8 Minimum password length
TYRO_PASSWORD_MAX_LENGTH null Maximum password length (no limit when null)
TYRO_PASSWORD_REQUIRE_UPPERCASE false Require at least one uppercase letter
TYRO_PASSWORD_REQUIRE_LOWERCASE false Require at least one lowercase letter
TYRO_PASSWORD_REQUIRE_NUMBERS false Require at least one number
TYRO_PASSWORD_REQUIRE_SPECIAL_CHARS false Require at least one special character
TYRO_PASSWORD_REQUIRE_CONFIRMATION false Require a matching password_confirmation field
TYRO_PASSWORD_CHECK_COMMON false Block common or compromised passwords
TYRO_PASSWORD_DISALLOW_USER_INFO false Reject passwords containing the user's email or name

Sessions & tokens

Env var Default Description
DELETE_PREVIOUS_ACCESS_TOKENS_ON_LOGIN false Revoke all previous tokens on login (single-session mode)

Audit trail

Env var Default Description
TYRO_AUDIT_ENABLED true Enable the database-backed audit trail
TYRO_AUDIT_RETENTION_DAYS 30 Days audit logs are kept before purging

Cache

Env var Default Description
TYRO_CACHE_ENABLED true Cache per-user role/privilege lookups
TYRO_CACHE_TTL 300 Seconds role/privilege lookups are cached
TYRO_CACHE_STORE null Cache store to use (null uses Laravel's default)

Related resources

License

Tyro is open-sourced software licensed under the MIT license.


All versions of tyro with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/auth Version ^12.0 || ^13.0
illuminate/database Version ^12.0 || ^13.0
illuminate/support Version ^12.0 || ^13.0
illuminate/http Version ^12.0 || ^13.0
laravel/sanctum Version ^4.0 || ^5.0
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 hasinhayder/tyro contains the following files

Loading the files please wait ...