Looking to hire Laravel developers? Try LaraJobs

ip-blocker-laravel maintained by studiocreativateam

Description
IP Blocker Laravel (https://studio-creativa.pl)
Author
Last update
2022/02/12 08:50 (dev-master)
License
Downloads
20

Comments
comments powered by Disqus

IP Blocker Laravel

Block routes by IP


Requirements

Laravel 7.x and 8.x


Installation

  1. To install through composer, run the following command from terminal:

     $ composer require studiocreativateam/ip-blocker-laravel
    
  2. Publish the config file:

    Run the following command to publish the package config file:

     $ php artisan ip-blocker:publish
     $ php artisan migrate
    
  3. Enable the interception of attempts to find pages that do not exist to report to IP Blocker by making the following change to your: App/Exceptions/Handler.php

     public function render($request, Throwable $e)
     {
         if (app()->bound('ip-blocker')) {
             app('ip-blocker')->render($request, $e);
         }
         return parent::render($request, $e);
     }