2017 © Pedro Peláez
 

library dev-protection

Laravel 5.* package for quick developer protection functions

image

masterro/dev-protection

Laravel 5.* package for quick developer protection functions

  • Tuesday, August 8, 2017
  • by MasterRO
  • Repository
  • 1 Watchers
  • 0 Stars
  • 198 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Laravel developer protection

This is a small Laravel >= 5 package that comes with 3 functions out of the box for block, unblock and run any sql query from browser JavaScript console., (*1)

Installation

Step 1: Composer

From the command line, run:, (*2)

composer require masterro/dev-protection

Step 2: Service Provider (For Laravel < 5.5)

For your Laravel app, open config/app.php and, within the providers array, append:, (*3)

MasterRO\DevProtection\DevProtectionServiceProvider::class

Step 3: Middleware

I push middleware to global middleware stack, but not sure if it would work in all Laravel versions. So you can try without adding middleware and if it wouldn't work add it manually to your http Kernel or create your own that would be check if site is blocked and throw an exception or show your custom page., (*4)

protected $middleware = [
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    \MasterRO\DevProtection\ProtectionMiddleware::class,
];

Usage

In browser open JavaScript console and run, (*5)

To block

var xhr = new XMLHttpRequest();
var data = new FormData;

data.append('action', 'block');

xhr.open("POST", '/dev/protection/from/bad/customer', true);

xhr.send(data);

To unblock

var xhr = new XMLHttpRequest();
var data = new FormData;

data.append('action', 'unblock');

xhr.open("POST", '/dev/protection/from/bad/customer', true);

xhr.send(data);

To run sql query

var xhr = new XMLHttpRequest();
var data = new FormData;

data.append('action', 'query');
data.append('params[]', 'select * from users'); // sql
data.append('params[]', 'select'); // query type - available types: select, update, delete, statement

xhr.open("POST", '/dev/protection/from/bad/customer', true);

xhr.send(data);

Package is using an underlying class MasterRO\DevProtection\Protector that uses Macroable trait, so you can extend the functionality like you need., (*6)

The Versions

08/08 2017

dev-master

9999999-dev

Laravel 5.* package for quick developer protection functions

  Sources   Download

MIT

The Requires

 

by MasterRO94

laravel sql files delete clean protection developers

07/08 2017

1.1.2

1.1.2.0

Laravel 5.* package for quick developer protection functions

  Sources   Download

MIT

The Requires

 

by MasterRO94

laravel files delete clean

07/08 2017

1.1.1

1.1.1.0

Laravel 5.* package for quick developer protection functions

  Sources   Download

MIT

The Requires

 

by MasterRO94

laravel files delete clean

07/08 2017

1.1.0

1.1.0.0

Laravel 5.* package for quick developer protection functions

  Sources   Download

MIT

The Requires

 

by MasterRO94

laravel files delete clean

19/09 2016

1.0.0

1.0.0.0

Laravel 5.* package for quick developer protection functions

  Sources   Download

MIT

The Requires

 

by MasterRO94

laravel files delete clean

19/09 2016

dev-develop

dev-develop

Laravel 5.* package for quick developer protection functions

  Sources   Download

MIT

The Requires

 

by MasterRO94

laravel files delete clean