-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from ledgerleapllc/staging
Sync staging to master
- Loading branch information
Showing
16 changed files
with
1,144 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api\V1; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
use App\Models\PagePermission; | ||
|
||
class BlockAccessController extends Controller | ||
{ | ||
public function updateBlockAccess(Request $request) { | ||
$params = $request->all(); | ||
$userId = (int) data_get($params, 'userId', 0); | ||
$name = data_get($params, 'name'); | ||
$blocked = (int) data_get($params, 'blocked', 0); | ||
if ($userId && $name) { | ||
$permission = PagePermission::where('user_id', $userId)->where('name', $name)->first(); | ||
if (!$permission) $permission = new PagePermission; | ||
$permission->user_id = $userId; | ||
$permission->name = $name; | ||
$permission->is_permission = 1 - $blocked; | ||
$permission->save(); | ||
return $this->successResponse($permission); | ||
} | ||
return $this->metaSuccess(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.