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
7d6c9fee
Unverified
Commit
7d6c9fee
authored
Mar 08, 2018
by
Viral Solani
Committed by
GitHub
Mar 08, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #157 from viralsolani/analysis-XpleaW
Apply fixes from StyleCI
parents
82677a91
b87b272e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
+8
-12
BlogTagsController.php
app/Http/Controllers/Api/V1/BlogTagsController.php
+2
-4
BlogsController.php
app/Http/Controllers/Api/V1/BlogsController.php
+5
-5
BlogTagsResource.php
app/Http/Resources/BlogTagsResource.php
+1
-2
BlogsResource.php
app/Http/Resources/BlogsResource.php
+0
-1
No files found.
app/Http/Controllers/Api/V1/BlogTagsController.php
View file @
7d6c9fee
...
...
@@ -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
;
...
...
app/Http/Controllers/Api/V1/BlogsController.php
View file @
7d6c9fee
...
...
@@ -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
...
...
app/Http/Resources/BlogTagsResource.php
View file @
7d6c9fee
...
...
@@ -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
,
];
...
...
app/Http/Resources/BlogsResource.php
View file @
7d6c9fee
...
...
@@ -15,7 +15,6 @@ class BlogsResource extends Resource
*/
public
function
toArray
(
$request
)
{
return
[
'id'
=>
$this
->
id
,
'name'
=>
$this
->
name
,
...
...
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