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
27397fa7
Unverified
Commit
27397fa7
authored
Apr 02, 2019
by
Viral Solani
Committed by
GitHub
Apr 02, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #380 from vidhyut-pandya/develop
Misc Changes
parents
8e8f320b
382de0ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
BlogTagsController.php
app/Http/Controllers/Api/V1/BlogTagsController.php
+1
-1
PagesController.php
app/Http/Controllers/Api/V1/PagesController.php
+1
-1
RedirectIfAuthenticated.php
app/Http/Middleware/RedirectIfAuthenticated.php
+9
-0
api.php
routes/api.php
+3
-6
No files found.
app/Http/Controllers/Api/V1/BlogTagsController.php
View file @
27397fa7
...
...
@@ -82,7 +82,7 @@ class BlogTagsController extends APIController
$validation
=
$this
->
validatingRequest
(
$request
,
$blog_tag
->
id
);
if
(
$validation
->
fails
())
{
return
$this
->
throwValidation
(
$validation
);
return
$this
->
throwValidation
(
$validation
->
messages
()
->
first
()
);
}
$this
->
repository
->
update
(
$blog_tag
,
$request
->
all
());
...
...
app/Http/Controllers/Api/V1/PagesController.php
View file @
27397fa7
...
...
@@ -31,7 +31,7 @@ class PagesController extends APIController
{
$limit
=
$request
->
get
(
'paginate'
)
?
$request
->
get
(
'paginate'
)
:
25
;
$orderBy
=
$request
->
get
(
'orderBy'
)
?
$request
->
get
(
'orderBy'
)
:
'ASC'
;
$sortBy
=
$request
->
get
(
'sortBy'
)
?
$request
->
get
(
'sortBy'
)
:
config
(
'module.pages.table'
,
'pages'
)
.
'created_at'
;
$sortBy
=
$request
->
get
(
'sortBy'
)
?
$request
->
get
(
'sortBy'
)
:
config
(
'module.pages.table'
,
'pages'
)
.
'
.
created_at'
;
return
PagesResource
::
collection
(
$this
->
repository
->
getForDataTable
()
->
orderBy
(
$sortBy
,
$orderBy
)
->
paginate
(
$limit
)
...
...
app/Http/Middleware/RedirectIfAuthenticated.php
View file @
27397fa7
...
...
@@ -22,6 +22,15 @@ class RedirectIfAuthenticated
return
redirect
(
'/'
);
}
if
(
$request
->
wantsJson
()
&&
auth
()
->
guard
(
'api'
)
->
user
())
{
return
response
([
'error'
=>
[
'message'
=>
'Not allowed'
,
'status_code'
=>
403
,
],
],
403
);
}
return
$next
(
$request
);
}
}
routes/api.php
View file @
27397fa7
...
...
@@ -13,18 +13,16 @@
*/
Route
::
group
([
'namespace'
=>
'Api\V1'
,
'prefix'
=>
'v1'
,
'as'
=>
'v1.'
],
function
()
{
Route
::
group
([
'prefix'
=>
'auth'
],
function
()
{
Route
::
group
([
'prefix'
=>
'auth'
,
'middleware'
=>
[
'guest'
]
],
function
()
{
Route
::
post
(
'register'
,
'RegisterController@register'
);
Route
::
post
(
'login'
,
'AuthController@login'
);
// Password Reset
Route
::
post
(
'password/email'
,
'ForgotPasswordController@sendResetLinkEmail'
);
});
Route
::
group
([
'middleware'
=>
[
'auth:api'
]],
function
()
{
Route
::
group
([
'prefix'
=>
'auth'
],
function
()
{
Route
::
post
(
'logout'
,
'AuthController@logout'
);
Route
::
post
(
'refresh'
,
'AuthController@refresh'
);
// Password Reset Routes
Route
::
post
(
'password/email'
,
'ForgotPasswordController@sendResetLinkEmail'
);
// Route::post('password/reset', 'ResetPasswordController@reset')->name('password.reset');
});
// Users
...
...
@@ -36,7 +34,6 @@ Route::group(['namespace' => 'Api\V1', 'prefix' => 'v1', 'as' => 'v1.'], functio
// Roles
Route
::
resource
(
'roles'
,
'RolesController'
,
[
'except'
=>
[
'create'
,
'edit'
]]);
Route
::
post
(
'roles/delete-all'
,
'RolesController@deleteAll'
);
// Permission
Route
::
resource
(
'permissions'
,
'PermissionController'
,
[
'except'
=>
[
'create'
,
'edit'
]]);
...
...
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