Skip to content

Commit

Permalink
Move file config/phpsoft.users.php to package Users #86
Browse files Browse the repository at this point in the history
  • Loading branch information
gghoantt committed Nov 26, 2015
1 parent e77a2bb commit a8e394b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 1 addition & 2 deletions packages/Users/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class UserController extends Controller

public function __construct()
{
$this->userModel = config('phpsoft.user.model');
$this->userModel = config('phpsoft.users.model');
}

/**
Expand Down Expand Up @@ -66,7 +66,6 @@ public function store(Request $request)
}

$userModel = $this->userModel;

$user = $userModel::create($request->all());

return response()->json(arrayView('phpsoft.users::user/read', [
Expand Down
4 changes: 2 additions & 2 deletions packages/Users/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class User extends Model
*/
public static function create(array $attributes = [])
{
$userModel = config('phpsoft.user.model');
$userModel = config('phpsoft.users.model');
$attributes['password'] = bcrypt($attributes['password']);

$user = new $userModel($attributes);
Expand Down Expand Up @@ -99,7 +99,7 @@ public function changePassword($newPassword)
*/
public static function browse($options = [])
{
$userModel = config('phpsoft.user.model');
$userModel = config('phpsoft.users.model');

$find = new $userModel;
$fillable = $find->fillable;
Expand Down
6 changes: 5 additions & 1 deletion packages/Users/Providers/UserServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function boot()
$this->publishes([
__DIR__ . '/../config/jwt.php' => config_path('jwt.php'),
__DIR__ . '/../config/entrust.php' => config_path('entrust.php'),
__DIR__ . '/../config/phpsoft.user.php' => config_path('phpsoft.user.php'),
__DIR__ . '/../config/phpsoft.users.php' => config_path('phpsoft.users.php'),
]);

// Register commands
Expand All @@ -38,6 +38,10 @@ public function boot()
*/
public function register()
{
$this->mergeConfigFrom(
__DIR__ . '/../config/phpsoft.users.php', 'phpsoft.users'
);

$this->registerCommands();
}

Expand Down
File renamed without changes.

0 comments on commit a8e394b

Please sign in to comment.