Unverified Commit 6bd33ef4 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #155 from viralsolani/analysis-8m64Kb

Apply fixes from StyleCI
parents dfdc6994 9dea5138
......@@ -29,7 +29,6 @@ class BlogCategoriesController extends APIController
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
return BlogCategoriesResource::collection(
......@@ -91,7 +90,6 @@ class BlogCategoriesController extends APIController
public function validatingRequest(Request $request)
{
$validation = Validator::make($request->all(), [
'name' => 'required|max:191',
]);
......
......@@ -29,7 +29,6 @@ class FaqsController extends APIController
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
return FaqsResource::collection(
......@@ -91,7 +90,6 @@ class FaqsController extends APIController
public function validatingRequest(Request $request)
{
$validation = Validator::make($request->all(), [
'question' => 'required|max:191',
'answer' => 'required',
......
......@@ -29,7 +29,6 @@ class PagesController extends APIController
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
return PagesResource::collection(
......@@ -91,7 +90,6 @@ class PagesController extends APIController
public function validatingRequest(Request $request)
{
$validation = Validator::make($request->all(), [
'title' => 'required|max:191',
'description' => 'required',
......
......@@ -65,7 +65,7 @@ class UsersController extends APIController
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
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
public function deleteUserList(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
return UserResource::collection(
$this->repository->getForDataTable(0, true)->paginate($limit)
);
......
......@@ -15,11 +15,10 @@ class BlogCategoriesResource extends Resource
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
'status' => ($this->isActive()) ? "Active" : "InActive",
'status' => ($this->isActive()) ? 'Active' : 'InActive',
'created_at' => optional($this->created_at)->toDateString(),
'created_by' => (isset($this->creator)) ? optional($this->creator)->first_name : $this->user_name,
];
......
......@@ -15,12 +15,11 @@ class FaqsResource extends Resource
*/
public function toArray($request)
{
return [
'id' => $this->id,
'question' => $this->question,
'answer' => $this->answer,
'status' => ($this->isActive()) ? "Active" : "InActive",
'status' => ($this->isActive()) ? 'Active' : 'InActive',
'created_at' => $this->created_at->toDateString(),
];
}
......
......@@ -15,14 +15,13 @@ class PagesResource extends Resource
*/
public function toArray($request)
{
return [
'id' => $this->id,
'title' => $this->title,
'status_label' => $this->status_label,
'status' => ($this->isActive())?"Active":"InActive",
'status' => ($this->isActive()) ? 'Active' : 'InActive',
'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