Git Product home page Git Product logo

dcat-sudo's Introduction

Demonstration

Licence: MIT

A Laravel 5.4 utility package to enable developers to log in as other users during development.

Installation

To install the package, simply follow the steps below.

Install the package using Composer:

$ composer require viacreative/sudo-su

Add the package's service provider to your app in your project's AppServiceProvider:

class AppServiceProvider extends ServiceProvider
{
    public function register()
    {
        if (config('app.debug')) {
            $this->app->register('VIACreative\SudoSu\ServiceProvider');
        }
    }
}

โš ๏ธ Warning: You should not register the provider globally like usual in the config/app.php file. View the disclaimer here for more information.

Include the partial in your layout file.

@if (config('app.debug'))
    @include('sudosu::user-selector')
@endif

Finally, publish the package's assets (the package won't work without this):

$ php artisan vendor:publish

Config

After running vendor:publish, a config file called sudosu.php should appear in your project. Within here, there are two configuration values:

sudosu.allowed_tlds array

By default, the package will disable itself on any domains that don't have a TLD of .dev or .local. This is a security measure to reduce the risk of accidentally enabling the package in production. If you have a different TLD in development, you can edit the config option sudosu.allowed_tlds.

sudosu.user_model string

The path to the application User model. This will be used to retrieve the users displayed in the select dropdown. This must be an Eloquent Model instance. This is set to App\User by default.

Disclaimer - DANGER!

This package can pose a serious security issue if used incorrectly, as anybody will be able to take control of any user's account. Please ensure that the service provider is only registered when the app is in a debug/local environment.

By default, the package will disable itself on any domains that don't have a TLD of .dev or .local. This is a security measure to reduce the risk of accidentally enabling the package in production. If you have a different TLD in development, you can edit the config option sudosu.allowed_tlds.

By using this package, you agree that VIA Creative and the contributors of this package cannot be held responsible for any damages caused by using this package.

dcat-sudo's People

Contributors

amaelftah avatar hrodrigues1984 avatar krve avatar lex111 avatar mrterryh avatar viacreativedev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.