Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
ee136503
Commit
ee136503
authored
Mar 13, 2018
by
cygnet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refacter users to create new controller for deactivated and deleted users
parent
c6c1e4c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
33 deletions
+84
-33
DeactivatedUsersController.php
app/Http/Controllers/Api/V1/DeactivatedUsersController.php
+41
-0
DeletedUsersController.php
app/Http/Controllers/Api/V1/DeletedUsersController.php
+42
-0
UsersController.php
app/Http/Controllers/Api/V1/UsersController.php
+1
-33
No files found.
app/Http/Controllers/Api/V1/DeactivatedUsersController.php
0 → 100644
View file @
ee136503
<?php
namespace
App\Http\Controllers\Api\V1
;
use
App\Events\Backend\Access\User\UserCreated
;
use
App\Events\Backend\Access\User\UserUpdated
;
use
App\Http\Resources\UserResource
;
use
App\Models\Access\User\User
;
use
App\Repositories\Backend\Access\User\UserRepository
;
use
Illuminate\Http\Request
;
use
Validator
;
class
DeactivatedUsersController
extends
APIController
{
protected
$repository
;
/**
* __construct.
*
* @param $repository
*/
public
function
__construct
(
UserRepository
$repository
)
{
$this
->
repository
=
$repository
;
}
/**
* Return the deactivated users.
*
* @param Request $request
*
* @return \Illuminate\Http\JsonResponse
*/
public
function
index
(
Request
$request
)
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
UserResource
::
collection
(
$this
->
repository
->
getForDataTable
(
0
,
false
)
->
paginate
(
$limit
)
);
}
}
app/Http/Controllers/Api/V1/DeletedUsersController.php
0 → 100644
View file @
ee136503
<?php
namespace
App\Http\Controllers\Api\V1
;
use
App\Events\Backend\Access\User\UserCreated
;
use
App\Events\Backend\Access\User\UserUpdated
;
use
App\Http\Resources\UserResource
;
use
App\Models\Access\User\User
;
use
App\Repositories\Backend\Access\User\UserRepository
;
use
Illuminate\Http\Request
;
use
Validator
;
class
DeletedUsersController
extends
APIController
{
protected
$repository
;
/**
* __construct.
*
* @param $repository
*/
public
function
__construct
(
UserRepository
$repository
)
{
$this
->
repository
=
$repository
;
}
/**
* Return the deleted users.
*
* @param Request $request
*
* @return \Illuminate\Http\JsonResponse
*/
public
function
index
(
Request
$request
)
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
UserResource
::
collection
(
$this
->
repository
->
getForDataTable
(
0
,
true
)
->
paginate
(
$limit
)
);
}
}
app/Http/Controllers/Api/V1/UsersController.php
View file @
ee136503
...
...
@@ -80,7 +80,7 @@ class UsersController extends APIController
* @param Request $request
* @param User $user
*
* @return
\Illuminate\Http\JsonResponse
* @return
Validator object
*/
public
function
update
(
Request
$request
,
User
$user
)
{
...
...
@@ -114,38 +114,6 @@ class UsersController extends APIController
]);
}
/**
* Return the deactivate users.
*
* @param Request
*
* @return \Illuminate\Http\JsonResponse
*/
public
function
deactivatedUserList
(
Request
$request
)
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
UserResource
::
collection
(
$this
->
repository
->
getForDataTable
(
0
,
false
)
->
paginate
(
$limit
)
);
}
/**
* Return the deleted users.
*
* @param User $user
*
* @return \Illuminate\Http\JsonResponse
*/
public
function
deleteUserList
(
Request
$request
)
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
UserResource
::
collection
(
$this
->
repository
->
getForDataTable
(
0
,
true
)
->
paginate
(
$limit
)
);
}
/**
* validateUser User.
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment