Commit 327ad995 authored by cygnet's avatar cygnet

Merge branch 'develop' of git://github.com/viralsolani/laravel-adminpanel into develop

parents c5d4d729 6bd33ef4
...@@ -29,7 +29,6 @@ class BlogCategoriesController extends APIController ...@@ -29,7 +29,6 @@ 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(
...@@ -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',
]); ]);
......
...@@ -29,7 +29,6 @@ class FaqsController extends APIController ...@@ -29,7 +29,6 @@ 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(
...@@ -91,7 +90,6 @@ class FaqsController extends APIController ...@@ -91,7 +90,6 @@ 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',
......
...@@ -29,7 +29,6 @@ class PagesController extends APIController ...@@ -29,7 +29,6 @@ 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(
...@@ -91,7 +90,6 @@ class PagesController extends APIController ...@@ -91,7 +90,6 @@ 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',
......
...@@ -65,7 +65,7 @@ class UsersController extends APIController ...@@ -65,7 +65,7 @@ class UsersController extends APIController
$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)
); );
} }
...@@ -79,6 +79,7 @@ class UsersController extends APIController ...@@ -79,6 +79,7 @@ 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)
); );
......
...@@ -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,
]; ];
......
...@@ -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(),
]; ];
} }
......
...@@ -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,
]; ];
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment