Git Product home page Git Product logo

nice-artisan's Introduction

Nice Artisan

This package is to add a web interface for Laravel 5 Artisan.

Installation

Add Nice Artisan to your composer.json file :

  • For Laravel 5.1
    composer require bestmomo/nice-artisan:0.3.*
  • For Laravel 5.2
    composer require bestmomo/nice-artisan:0.4.*
  • For Laravel 5.3
    composer require bestmomo/nice-artisan:0.5.*
  • For Laravel 5.4
    composer require bestmomo/nice-artisan:1.0.*
  • For Laravel 5.5
    composer require bestmomo/nice-artisan

For Laravel < 5.5 the next required step is to add the service provider to config/app.php (for Laravel 5.5 there is the package discovery) :

    Bestmomo\NiceArtisan\NiceArtisanServiceProvider::class,

Last copy the package config to your local config with the publish command:

    php artisan vendor:publish --tag=niceartisan:config

You can change options and commands in config/commands.php. The menu is dynamically created with this config.

Now it must work with this url (you can also change it in the config file):

    .../niceartisan

Middleware

If you want to use this package on a production application you must protect the urls with a middleware for your security !

Add a route middleware to your application, for example :

<?php

namespace App\Http\Middleware;

use Closure;

class NiceArtisan
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $user = $request->user();

        if ($user && $user->isAdmin()) {
            return $next($request);
        }

        return redirect('/');
    }
}

And register it in Kernel with nice_artisan name :

'nice_artisan' => \App\Http\Middleware\NiceArtisan::class,

Screenshots

nice-artisan1 nice-artisan2 nice-artisan3

nice-artisan's People

Contributors

bestmomo avatar tom-rb avatar

Watchers

James Cloos 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.