Skip to content

Commit

Permalink
feat: disable backend
Browse files Browse the repository at this point in the history
  • Loading branch information
64knl committed Jan 30, 2024
1 parent 8dec369 commit 0f2b570
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
16 changes: 14 additions & 2 deletions config/listboss.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| Endpoint
|--------------------------------------------------------------------------
|
| Congifure the endpoint to use for the ListBoss API.
| Configure the endpoint to use for the ListBoss API.
|
*/

Expand Down Expand Up @@ -38,4 +38,16 @@

'ssl_verify' => env('LISTBOSS_SSL_VERIFY', true),

];
/*
|--------------------------------------------------------------------------
| Enable the backend
|--------------------------------------------------------------------------
|
| This can be used to disable the backend routes. This is useful if you
| want to use the API only.
|
*/

'backend' => env('LISTBOSS_BACKEND', true),

];
11 changes: 10 additions & 1 deletion src/Http/Controllers/ListBossController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class ListBossController extends Controller
{
public function index()
{
if( !config('listboss.backend'))
{
abort(404);
}

$widget = new LayoutWidgetHelper('Mailings', 'Resultaten van nieuwsbrieven inzien');
$widget = new LayoutWidgetHelper('Mailings', 'Resultaten van verzendingen inzien');
$widget->addBreadcrumb('Mailings');

$widget->widget->addForm($this->selectJob());
Expand All @@ -27,6 +31,11 @@ public function index()

public function status(FormDataRequest $request)
{
if( !config('listboss.backend'))
{
abort(404);
}

$request->validate([
'list' => 'required|integer',
]);
Expand Down

0 comments on commit 0f2b570

Please sign in to comment.