A Laravel Nova tool for the pre-launch and launch phases of your website.
nova-launch is a Laravel Nova tool for the pre-launch and launch phases of your website. It redirects visitors, allows bypasses and launches your website whenever you say the word.
I was working on a project with a friend when I took on the task of implementing functionality for disabling the website for visitors, while still allowing admins to access it. Furthermore, the site had to be launchable from within Nova.
Well, I created that functionality and kept refining it until I thought: maybe I should extract this from the project and wrap it in its own package?
So, I give you: nova-launch. It does the following:
- Disable the website for visitors by redirecting them to a single page (which is completely configurable by the developer). By default this page shows some basic information and a sign up form (table, model and store functionality are also included by default, because to me this seemed to be the most interesting functionality).
- Allow admins or people that know the secret (if enabled) full access to the website.
- Launch the website via Nova or the
php artisan nova-launch:launchcommand.
- Dispatch an event after launch, because you might want to do more after that!
- Completely disable itself after launch to lower the impact from multiple checks on each request.
This is my very first package, so suggestions and tips for me to improve this or future packages are welcome!
Install the package via Composer:
composer require dnwjn/nova-launch
The service provider will automatically be registered.
Publish the resources:
php artisan vendor:publish --provider="Dnwjn\NovaLaunch\NovaLaunchServiceProvider" --tag="minimal"
minimaltag only publishes the elements required by the package to work. See the table below for an overview of what can be published.
Run the migrations:
php artisan migrate
Edit the configuration file
config/nova-launch.phpto your likings. The most important parts here are:
The following tags can be used during publishing. This is done in the same way as in step 1 of the installation process:
php artisan vendor:publish --provider="Dnwjn\NovaLaunch\NovaLaunchServiceProvider" --tag="<tag>"
||config file and public files|
||translations (for visitor view)|
||stylesheets (for visitor view)|
||views (for visitor view)|
You can run tests with the following command:
composer run test
Note: tests are now very basic but more will be added in the future.
Please see CHANGELOG.md for information on what has changed.
This package uses the MIT License (MIT). Please see LICENSE.md for more information.