Unverified Commit 7d6c9fee authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #157 from viralsolani/analysis-XpleaW

Apply fixes from StyleCI
parents 82677a91 b87b272e
......@@ -29,9 +29,8 @@ class BlogTagsController extends APIController
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
return BlogTagsResource::collection(
$this->repository->getForDataTable()->paginate($limit)
);
......@@ -91,9 +90,8 @@ class BlogTagsController extends APIController
public function validatingRequest(Request $request, $id = 0)
{
$validation = Validator::make($request->all(), [
'name' => 'required|max:191|unique:blog_tags,name,'. $id,
'name' => 'required|max:191|unique:blog_tags,name,'.$id,
]);
return $validation;
......
......@@ -29,7 +29,6 @@ class BlogsController extends APIController
*/
public function index(Request $request)
{
$limit = $request->get('paginate') ? $request->get('paginate') : 25;
return BlogsResource::collection(
......@@ -89,10 +88,10 @@ class BlogsController extends APIController
return new BlogsResource($blog);
}
public function validatingRequest(Request $request, $type="insert")
public function validatingRequest(Request $request, $type = 'insert')
{
$featured_image = ($type=="insert")?"required":"";
$featured_image = ($type == 'insert') ? 'required' : '';
$validation = Validator::make($request->all(), [
'name' => 'required|max:191',
'featured_image' => $featured_image,
......@@ -103,6 +102,7 @@ class BlogsController extends APIController
return $validation;
}
public function messages()
{
return [
......@@ -110,7 +110,7 @@ class BlogsController extends APIController
'name.max' => 'Blog Title may not be greater than 191 characters.',
];
}
/**
* @param Blog $blog
* @param DeleteBlogRequest $request
......
......@@ -15,11 +15,10 @@ class BlogTagsResource 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,7 +15,6 @@ class BlogsResource extends Resource
*/
public function toArray($request)
{
return [
'id' => $this->id,
'name' => $this->name,
......
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