Skip to content

Commit 3a126b1

Browse files
committed
commit
0 parents  commit 3a126b1

11 files changed

+680
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
vendor/
2+
node_modules/
3+
4+
# Laravel 4 specific
5+
bootstrap/compiled.php
6+
app/storage/
7+
8+
# Laravel 5 & Lumen specific
9+
bootstrap/cache/
10+
.env.*.php
11+
.env.php
12+
.env
13+
14+
# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer
15+
.rocketeer/

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) Barna Szalai <[email protected]>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Laravel CLI User
2+
> Manage users easily on command line
3+
4+
![Laravel Cli User](package.png)
5+
6+
You can quickly create, delete and list users on command line
7+
8+
## Requirements
9+
10+
PHP 5.4+
11+
Tested on Laravel 5.1, 5.2, 5.3 and 5.4
12+
13+
## Installation
14+
15+
```bash
16+
composer require subdesign/laravel-cli-user:dev-master
17+
```
18+
19+
Add the following line to the service providers array in the `config/app.php` file
20+
```php
21+
Subdesign\LaravelCliUser\CliUserServiceProvider::class
22+
```
23+
24+
Publish the config file
25+
```bash
26+
php artisan vendor:publish --provider="Subdesign\LaravelCliUser\CliUserServiceProvider"
27+
```
28+
## Configuration
29+
30+
Edit the `app/cliuser.php` config file to set where your User model exists.
31+
32+
```php
33+
return [
34+
'model' => 'App\User'
35+
];
36+
```
37+
38+
## Usage
39+
40+
#### Create user
41+
42+
```bash
43+
php artisan cliuser:create
44+
```
45+
46+
Show password letters
47+
```bash
48+
php artisan cliuser:create --show-password
49+
```
50+
51+
#### Delete user
52+
53+
Delete user by ID
54+
```bash
55+
php artisan cliuser:delete <id>
56+
```
57+
58+
Delete user by email
59+
```bash
60+
php artisan cliuser:delete <[email protected]>
61+
```
62+
> Of course do not enter < and > characters only an interger or string as email
63+
64+
#### List users
65+
66+
```bash
67+
php artisan cliuser:list
68+
```
69+
70+
## Credits
71+
72+
&copy; 2017 [Barna Szalai](https://github.com/subdesign)
73+
74+
## License
75+
76+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "subdesign/laravel-cli-user",
3+
"description": "Quickly create users on command line",
4+
"keywords": [
5+
"laravel",
6+
"cli",
7+
"user-manager"
8+
],
9+
"homepage": "https://github.com/subdesign/laravel-cli-user",
10+
"license": "MIT",
11+
"authors": [
12+
{
13+
"name": "Barna Szalai",
14+
"email": "[email protected]"
15+
}
16+
],
17+
"require": {
18+
"php": "^5.4.0 || ^7.0"
19+
},
20+
"autoload": {
21+
"psr-4": {
22+
"Subdesign\\LaravelCliUser\\": "src"
23+
}
24+
},
25+
"minimum-stability": "dev"
26+
}

config/cliuser.php

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
return [
4+
'model' => 'App\User'
5+
];

package.png

17.3 KB
Loading

src/CliUserServiceProvider.php

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace Subdesign\LaravelCliUser;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
use Subdesign\LaravelCliUser\Commands\CliUserCreateCommand;
7+
use Subdesign\LaravelCliUser\Commands\CliUserDeleteCommand;
8+
use Subdesign\LaravelCliUser\Commands\CliUserListCommand;
9+
10+
/**
11+
* Laravel CLI User - Service Provider
12+
*
13+
* @author Barna Szalai <[email protected]>
14+
*
15+
*/
16+
class CliUserServiceProvider extends ServiceProvider
17+
{
18+
/**
19+
* Bootstrap the application services.
20+
*
21+
* @return void
22+
*/
23+
public function boot()
24+
{
25+
$this->publishes([
26+
__DIR__.'/../config/cliuser.php' => config_path('cliuser.php'),
27+
], 'config');
28+
}
29+
30+
/**
31+
* Register the application services.
32+
*
33+
* @return void
34+
*/
35+
public function register()
36+
{
37+
$this->app->bind('command.cliuser.create', CliUserCreateCommand::class);
38+
$this->app->bind('command.cliuser.delete', CliUserDeleteCommand::class);
39+
$this->app->bind('command.cliuser.list', CliUserListCommand::class);
40+
41+
$this->commands([
42+
'command.cliuser.create',
43+
'command.cliuser.delete',
44+
'command.cliuser.list'
45+
]);
46+
}
47+
}

0 commit comments

Comments
 (0)