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
327ad995
Commit
327ad995
authored
Mar 08, 2018
by
cygnet
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
git://github.com/viralsolani/laravel-adminpanel
into develop
parents
c5d4d729
6bd33ef4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
17 additions
and
25 deletions
+17
-25
BlogCategoriesController.php
app/Http/Controllers/Api/V1/BlogCategoriesController.php
+1
-3
FaqsController.php
app/Http/Controllers/Api/V1/FaqsController.php
+2
-4
PagesController.php
app/Http/Controllers/Api/V1/PagesController.php
+2
-4
UsersController.php
app/Http/Controllers/Api/V1/UsersController.php
+6
-5
BlogCategoriesResource.php
app/Http/Resources/BlogCategoriesResource.php
+1
-2
FaqsResource.php
app/Http/Resources/FaqsResource.php
+1
-2
PagesResource.php
app/Http/Resources/PagesResource.php
+2
-3
api.php
routes/api.php
+2
-2
No files found.
app/Http/Controllers/Api/V1/BlogCategoriesController.php
View file @
327ad995
...
@@ -29,9 +29,8 @@ class BlogCategoriesController extends APIController
...
@@ -29,9 +29,8 @@ class BlogCategoriesController extends APIController
*/
*/
public
function
index
(
Request
$request
)
public
function
index
(
Request
$request
)
{
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
BlogCategoriesResource
::
collection
(
return
BlogCategoriesResource
::
collection
(
$this
->
repository
->
getForDataTable
()
->
paginate
(
$limit
)
$this
->
repository
->
getForDataTable
()
->
paginate
(
$limit
)
);
);
...
@@ -91,7 +90,6 @@ class BlogCategoriesController extends APIController
...
@@ -91,7 +90,6 @@ class BlogCategoriesController extends APIController
public
function
validatingRequest
(
Request
$request
)
public
function
validatingRequest
(
Request
$request
)
{
{
$validation
=
Validator
::
make
(
$request
->
all
(),
[
$validation
=
Validator
::
make
(
$request
->
all
(),
[
'name'
=>
'required|max:191'
,
'name'
=>
'required|max:191'
,
]);
]);
...
...
app/Http/Controllers/Api/V1/FaqsController.php
View file @
327ad995
...
@@ -29,9 +29,8 @@ class FaqsController extends APIController
...
@@ -29,9 +29,8 @@ class FaqsController extends APIController
*/
*/
public
function
index
(
Request
$request
)
public
function
index
(
Request
$request
)
{
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
FaqsResource
::
collection
(
return
FaqsResource
::
collection
(
$this
->
repository
->
getForDataTable
()
->
paginate
(
$limit
)
$this
->
repository
->
getForDataTable
()
->
paginate
(
$limit
)
);
);
...
@@ -91,10 +90,9 @@ class FaqsController extends APIController
...
@@ -91,10 +90,9 @@ class FaqsController extends APIController
public
function
validatingRequest
(
Request
$request
)
public
function
validatingRequest
(
Request
$request
)
{
{
$validation
=
Validator
::
make
(
$request
->
all
(),
[
$validation
=
Validator
::
make
(
$request
->
all
(),
[
'question'
=>
'required|max:191'
,
'question'
=>
'required|max:191'
,
'answer'
=>
'required'
,
'answer'
=>
'required'
,
]);
]);
return
$validation
;
return
$validation
;
...
...
app/Http/Controllers/Api/V1/PagesController.php
View file @
327ad995
...
@@ -29,9 +29,8 @@ class PagesController extends APIController
...
@@ -29,9 +29,8 @@ class PagesController extends APIController
*/
*/
public
function
index
(
Request
$request
)
public
function
index
(
Request
$request
)
{
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
PagesResource
::
collection
(
return
PagesResource
::
collection
(
$this
->
repository
->
getForDataTable
()
->
paginate
(
$limit
)
$this
->
repository
->
getForDataTable
()
->
paginate
(
$limit
)
);
);
...
@@ -91,9 +90,8 @@ class PagesController extends APIController
...
@@ -91,9 +90,8 @@ class PagesController extends APIController
public
function
validatingRequest
(
Request
$request
)
public
function
validatingRequest
(
Request
$request
)
{
{
$validation
=
Validator
::
make
(
$request
->
all
(),
[
$validation
=
Validator
::
make
(
$request
->
all
(),
[
'title'
=>
'required|max:191'
,
'title'
=>
'required|max:191'
,
'description'
=>
'required'
,
'description'
=>
'required'
,
]);
]);
...
...
app/Http/Controllers/Api/V1/UsersController.php
View file @
327ad995
...
@@ -56,19 +56,19 @@ class UsersController extends APIController
...
@@ -56,19 +56,19 @@ class UsersController extends APIController
/**
/**
* Return the specified resource.
* Return the specified resource.
*
*
* @param Request
* @param Request
*
*
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\Response
*/
*/
public
function
deactivatedUserList
(
Request
$request
)
public
function
deactivatedUserList
(
Request
$request
)
{
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
UserResource
::
collection
(
return
UserResource
::
collection
(
$this
->
repository
->
getForDataTable
(
0
,
false
)
->
paginate
(
$limit
)
$this
->
repository
->
getForDataTable
(
0
,
false
)
->
paginate
(
$limit
)
);
);
}
}
/**
/**
* Return the specified resource.
* Return the specified resource.
*
*
...
@@ -79,11 +79,12 @@ class UsersController extends APIController
...
@@ -79,11 +79,12 @@ class UsersController extends APIController
public
function
deleteUserList
(
Request
$request
)
public
function
deleteUserList
(
Request
$request
)
{
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
return
UserResource
::
collection
(
return
UserResource
::
collection
(
$this
->
repository
->
getForDataTable
(
0
,
true
)
->
paginate
(
$limit
)
$this
->
repository
->
getForDataTable
(
0
,
true
)
->
paginate
(
$limit
)
);
);
}
}
/**
/**
* Update the specified resource in storage.
* Update the specified resource in storage.
*/
*/
...
...
app/Http/Resources/BlogCategoriesResource.php
View file @
327ad995
...
@@ -15,11 +15,10 @@ class BlogCategoriesResource extends Resource
...
@@ -15,11 +15,10 @@ class BlogCategoriesResource extends Resource
*/
*/
public
function
toArray
(
$request
)
public
function
toArray
(
$request
)
{
{
return
[
return
[
'id'
=>
$this
->
id
,
'id'
=>
$this
->
id
,
'name'
=>
$this
->
name
,
'name'
=>
$this
->
name
,
'status'
=>
(
$this
->
isActive
())
?
"Active"
:
"InActive"
,
'status'
=>
(
$this
->
isActive
())
?
'Active'
:
'InActive'
,
'created_at'
=>
optional
(
$this
->
created_at
)
->
toDateString
(),
'created_at'
=>
optional
(
$this
->
created_at
)
->
toDateString
(),
'created_by'
=>
(
isset
(
$this
->
creator
))
?
optional
(
$this
->
creator
)
->
first_name
:
$this
->
user_name
,
'created_by'
=>
(
isset
(
$this
->
creator
))
?
optional
(
$this
->
creator
)
->
first_name
:
$this
->
user_name
,
];
];
...
...
app/Http/Resources/FaqsResource.php
View file @
327ad995
...
@@ -15,12 +15,11 @@ class FaqsResource extends Resource
...
@@ -15,12 +15,11 @@ class FaqsResource extends Resource
*/
*/
public
function
toArray
(
$request
)
public
function
toArray
(
$request
)
{
{
return
[
return
[
'id'
=>
$this
->
id
,
'id'
=>
$this
->
id
,
'question'
=>
$this
->
question
,
'question'
=>
$this
->
question
,
'answer'
=>
$this
->
answer
,
'answer'
=>
$this
->
answer
,
'status'
=>
(
$this
->
isActive
())
?
"Active"
:
"InActive"
,
'status'
=>
(
$this
->
isActive
())
?
'Active'
:
'InActive'
,
'created_at'
=>
$this
->
created_at
->
toDateString
(),
'created_at'
=>
$this
->
created_at
->
toDateString
(),
];
];
}
}
...
...
app/Http/Resources/PagesResource.php
View file @
327ad995
...
@@ -15,14 +15,13 @@ class PagesResource extends Resource
...
@@ -15,14 +15,13 @@ class PagesResource extends Resource
*/
*/
public
function
toArray
(
$request
)
public
function
toArray
(
$request
)
{
{
return
[
return
[
'id'
=>
$this
->
id
,
'id'
=>
$this
->
id
,
'title'
=>
$this
->
title
,
'title'
=>
$this
->
title
,
'status_label'
=>
$this
->
status_label
,
'status_label'
=>
$this
->
status_label
,
'status'
=>
(
$this
->
isActive
())
?
"Active"
:
"InActive"
,
'status'
=>
(
$this
->
isActive
())
?
'Active'
:
'InActive'
,
'created_at'
=>
$this
->
created_at
->
toDateString
(),
'created_at'
=>
$this
->
created_at
->
toDateString
(),
'created_by'
=>
is_int
(
$this
->
created_by
)
?
optional
(
$this
->
owner
)
->
first_name
:
$this
->
created_by
,
'created_by'
=>
is_int
(
$this
->
created_by
)
?
optional
(
$this
->
owner
)
->
first_name
:
$this
->
created_by
,
];
];
}
}
}
}
routes/api.php
View file @
327ad995
...
@@ -34,7 +34,7 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
...
@@ -34,7 +34,7 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
Route
::
get
(
'deleteUsers'
,
'UsersController@deleteUserList'
);
Route
::
get
(
'deleteUsers'
,
'UsersController@deleteUserList'
);
});
});
Route
::
resource
(
'users'
,
'UsersController'
);
Route
::
resource
(
'users'
,
'UsersController'
);
// Roles
// Roles
Route
::
resource
(
'roles'
,
'RolesController'
);
Route
::
resource
(
'roles'
,
'RolesController'
);
// Permission
// Permission
...
@@ -42,7 +42,7 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
...
@@ -42,7 +42,7 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
// Page
// Page
Route
::
resource
(
'pages'
,
'PagesController'
);
Route
::
resource
(
'pages'
,
'PagesController'
);
// Faqs
// Faqs
Route
::
resource
(
'faqs'
,
'FaqsController'
);
Route
::
resource
(
'faqs'
,
'FaqsController'
);
...
...
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