Download the PHP package bbs-lab/nova-force-two-factor without Composer

On this page you can find all versions of the php package bbs-lab/nova-force-two-factor. 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 nova-force-two-factor

Nova Force Two Factor

Latest Version on Packagist Tests Total Downloads

Make Laravel Nova's built-in two-factor authentication mandatory. Nova's 2FA (via Fortify) is opt-in; this package adds a middleware that redirects any authenticated admin who has not enrolled to the User Security page — with a toast explaining why — until they set it up.

The redirect notice is shown with bbs-lab/nova-toast.

Requirements

Nova's built-in two-factor authentication must be enabled (Nova::fortify() with Features::twoFactorAuthentication()), and your Nova user must carry Fortify's Laravel\Fortify\TwoFactorAuthenticatable trait — the middleware reads its hasEnabledTwoFactorAuthentication() method. A user model without that method is left alone.

Nova's built-in User Security / 2FA page (nova.pages.user-security) is Nova 5 only, so this package requires Nova 5. It is exercised in CI on Laravel 11/12/13 and PHP 8.3/8.4/8.5.

Installation

Because Nova is a paid, private package, make sure your application is already authenticated against nova.laravel.com, then:

The service provider is auto-discovered and injects the middleware into Nova's stack for you — there is nothing else to wire up. It is enforced by default.

Configuration

Publish the config if you want to tweak it:

The toast wording lives in the package translations; publish them to customise:

How it works

The middleware runs through Nova's nova middleware group, which is nested inside the api/asset stacks too — so it sees page visits and every script/style/XHR request. It treats each kind correctly:

An admin who has enrolled, an anonymous request, and the allow-listed routes/paths all pass straight through.

Manual middleware registration

Set auto_register_middleware to false and add the middleware where you want it, e.g. in config/nova.php:

Testing

A full embedded Nova app (via Orchestra Workbench) lets you exercise the flow in a real Nova instance:

Security

The middleware only gates access and flashes a message — it stores no data and exposes no endpoint. If you discover a security issue, please email [email protected] instead of using the issue tracker.

Changelog

Please see CHANGELOG for what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

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


All versions of nova-force-two-factor with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
bbs-lab/nova-toast Version ^1.0
illuminate/contracts Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
laravel/nova Version ^5.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 bbs-lab/nova-force-two-factor contains the following files

Loading the files please wait ...