Skip to content

Commit

Permalink
response method
Browse files Browse the repository at this point in the history
  • Loading branch information
jromero98 committed Jan 25, 2020
1 parent d16e7a6 commit d209a6d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Entrust/Middleware/EntrustAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function handle($request, Closure $next, $roles, $permissions, $validateA
if ($this->auth->guest() || !$request->user()->ability($roles, $permissions, [ 'validate_all' => $validateAll ])) {
switch (Config::get('entrust.type')) {
case 'api':
return Response::json(Config::get('entrust.response-error'),403);
return response()->json(Config::get('entrust.response-error'),403);
break;
default:
abort(403);
Expand Down
2 changes: 1 addition & 1 deletion src/Entrust/Middleware/EntrustPermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function handle($request, Closure $next, $permissions)
if ($this->auth->guest() || !$request->user()->cans($permissions)) {
switch (Config::get('entrust.type')) {
case 'api':
return Response::json(Config::get('entrust.response-error'),403);
return response()->json(Config::get('entrust.response-error'),403);
break;
default:
abort(403);
Expand Down
2 changes: 1 addition & 1 deletion src/Entrust/Middleware/EntrustRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function handle($request, Closure $next, $roles)
if ($this->auth->guest() || !$request->user()->hasRole($roles)) {
switch (Config::get('entrust.type')) {
case 'api':
return Response::json(Config::get('entrust.response-error'),403);
return response()->json(Config::get('entrust.response-error'),403);
break;
default:
abort(403);
Expand Down
2 changes: 1 addition & 1 deletion src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@
'permission_foreign_key' => 'permission_id',

'type' => 'web',
'response-error' => '{Unauthorized}'
'response-error' => 'Unauthorized'
];

1 comment on commit d209a6d

@sraiyani
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you @jromero98

Please sign in to comment.