Skip to content

Commit c45acfd

Browse files
committed
Add L7 support
1 parent 2f9df2b commit c45acfd

7 files changed

+26
-20
lines changed

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
],
1010
"require": {
1111
"php": ">=7.0",
12-
"illuminate/support": ">=5.2",
13-
"illuminate/database": ">=5.2",
14-
"illuminate/console": ">=5.2"
12+
"illuminate/support": "^5.2 || 6.* || 7.*",
13+
"illuminate/database": "^5.2 || 6.* || 7.*",
14+
"illuminate/console": "^5.2 || 6.* || 7.*"
1515
},
1616
"autoload": {
1717
"psr-4": {

config/user-commands.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
return [
6-
'models' => [
6+
'models' => [
77
'user' => App\Models\User::class,
88
'role' => App\Models\Role::class,
99
],
10-
'columns' => [
11-
'id' => 'id',
12-
'email' => 'email',
13-
'name' => 'name',
10+
'columns' => [
11+
'id' => 'id',
12+
'email' => 'email',
13+
'name' => 'name',
1414
'password' => 'password',
1515
],
1616

@@ -30,6 +30,6 @@
3030
'id',
3131
'name',
3232
],
33-
'attach_method' => 'attachRole'
33+
'attach_method' => 'attachRole',
3434
],
3535
];

src/Console/Commands/AssignRole.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace McMatters\UserCommands\Console\Commands;
66

@@ -104,7 +104,11 @@ protected function getRole(array $config): Model
104104

105105
$identity = $this->argument('role');
106106
$roleModel = Arr::get($config, 'models.role');
107-
$identifiers = Arr::get($config, 'update_password.role_identifiers', ['id']);
107+
$identifiers = Arr::get(
108+
$config,
109+
'update_password.role_identifiers',
110+
['id']
111+
);
108112

109113
/** @var \Illuminate\Database\Eloquent\Builder $query */
110114
$query = $roleModel::query();
@@ -125,10 +129,11 @@ protected function getRole(array $config): Model
125129
*/
126130
protected function checkRoleModel(array $config)
127131
{
128-
if (empty($config['models']['role']) ||
132+
if (
133+
empty($config['models']['role']) ||
129134
!class_exists($config['models']['role'])
130135
) {
131-
throw new RuntimeException('Please provide the "Role" model.');
136+
throw new RuntimeException('Please provide the "Role" model');
132137
}
133138
}
134139
}

src/Console/Commands/BaseCommand.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace McMatters\UserCommands\Console\Commands;
66

@@ -99,10 +99,11 @@ protected function getUser(array $config): Model
9999
*/
100100
protected function checkUserModel(array $config)
101101
{
102-
if (empty($config['models']['user']) ||
102+
if (
103+
empty($config['models']['user']) ||
103104
!class_exists($config['models']['user'])
104105
) {
105-
throw new RuntimeException('Please provide the "User" model.');
106+
throw new RuntimeException('Please provide the "User" model');
106107
}
107108
}
108109
}

src/Console/Commands/Sanitize.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace McMatters\UserCommands\Console\Commands;
66

src/Console/Commands/UpdatePassword.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace McMatters\UserCommands\Console\Commands;
66

src/ServiceProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace McMatters\UserCommands;
66

0 commit comments

Comments
 (0)