Package Data | |
---|---|
Maintainer Username: | bestmomo |
Maintainer Contact: | grandheretique@free.fr (Bestmomo) |
Package Create Date: | 2015-11-07 |
Package Last Update: | 2024-07-13 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:17:21 |
Package Statistics | |
---|---|
Total Downloads: | 131,517 |
Monthly Downloads: | 753 |
Daily Downloads: | 37 |
Total Stars: | 213 |
Total Watchers: | 10 |
Total Forks: | 23 |
Total Open Issues: | 10 |
This package is to add a web interface for Laravel 5 Artisan.
Add Nice Artisan to your composer.json file :
composer require bestmomo/nice-artisan:0.3.*
composer require bestmomo/nice-artisan:0.4.*
composer require bestmomo/nice-artisan:0.5.*
composer require bestmomo/nice-artisan:1.0.*
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
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,