Coder Social home page Coder Social logo

artisan-ui's Introduction

🧰 Artisan UI

Latest Version on Packagist GitHub Tests Action Status Total Downloads

artisan-ui

Installation

composer require lorisleiva/artisan-ui
php artisan artisan-ui:install

Usage

Just go to /artisan and enjoy! 🌺

Capture 2021-06-13T21 53 30 3

Configure access

By default, Artisan UI is only available on local environments. You can provide your own custom authorization logic by providing a callback to the ArtisanUI::auth method. As usual, you may add this logic to any of your service providers.

The following example allows any user on local environments but only admin users on other environments.

use Lorisleiva\ArtisanUI\Facades\ArtisanUI;

ArtisanUI::auth(function ($request) {
    if (app()->environment('local')) {
        return true;
    }

    return $request->check() && $request->user()->isAdmin();
});

Configure routes

You may change the path and domain of the Artisan UI routes to suit your need using the configuration file located in config/artisan-ui.php.

Additionally, you may use this configuration file to update the middleware of these routes. By default, the web middleware group is used as well as the AuthorizeArtisanUI middleware which protects the Artisan UI routes using the callback provided to the ArtisanUI::auth method above. Feel free to override that middleware for more custom authorization logic but remember that, without it, the Artisan UI routes will be available to everyone!

Update assets

If you've recently updated the package and something doesn't look right, it might be because the CSS file for the package is not up-to-date and needs to be re-published. Worry not, simply run the artisan-ui:install command again and you're good to go. You can even do that from the UI now! 🤯

php artisan artisan-ui:install

artisan-ui's People

Contributors

lorisleiva avatar

Watchers

 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.