felixdorn / laravel-rickroll
Rickrolls people trying to break your site.
Installs: 7 175
Dependents: 0
Suggesters: 0
Security: 0
Stars: 89
Watchers: 3
Forks: 6
Open Issues: 1
Requires
- php: ^8
- illuminate/routing: ^8|^9|^10
- illuminate/support: ^8|^9|^10
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.6
- orchestra/testbench: ^6|^7|^8
- phpstan/phpstan: ^1.4.6
- phpunit/phpunit: ^8|^9
README
RickRoll for Laravel
Rickrolls people trying to break your site. This package is inspired by Liam Hammett's tweet.
Getting started
You can install the package via composer, if you don't have composer installed, you can download it here:
composer require felixdorn/laravel-rickroll
Or by adding a requirement in your composer.json
:
{ "require": { "felixdorn/laravel-rickroll": "dev-master" } }
We need your knowledge!
Do you know any well-known url that "hackers" use to gather information/secrets ? Add these here, thanks!
Usage
On your routes/web.php
just add this single line, and we'll handle the rest for you!
use Felix\Rickroll\Facades\RickRoll; RickRoll::routes();
Redirecting to a custom URL
use Felix\Rickroll\Facades\RickRoll; RickRoll::routes()->redirectsTo('https://mycustom.url');
Remove all URLs
use Felix\Rickroll\Facades\RickRoll; RickRoll::routes()->clear();
Adding a URL
use Felix\Rickroll\Facades\RickRoll; RickRoll::routes()->push('/rickroll') ->push('/rickroll/{id}', [ 'id' => '[0-9]+' ]);
Helper
There is a rickroll
function available if you want to rickroll someone in one of your controllers.
rickroll('https://my-custom.url');
You don't need to return anything, it works just like an abort
.
Events
We're dispatching an event with the current request when someone is rick-rolled. Just listen
for Felix\RickRoll\Events\RickRolled
in your EventServiceProvider
.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email hi@felixdorn.fr instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.