-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create skeleton for implementing Coterm
- Loading branch information
1 parent
4376991
commit 9d179b5
Showing
5 changed files
with
61 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace Convoy\Http\Requests\Admin\Coterms; | ||
|
||
use Convoy\Http\Requests\BaseApiRequest; | ||
use Convoy\Models\Coterm; | ||
use Illuminate\Support\Arr; | ||
|
||
class StoreCotermRequest extends BaseApiRequest | ||
{ | ||
public function rules(): array | ||
{ | ||
$rules = Coterm::getRules(); | ||
|
||
return Arr::only($rules, ['name', 'is_tls_enabled', 'fqdn', 'port']); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
app/Http/Requests/Admin/Coterms/UpdateAttachedNodesRequest.php
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,16 @@ | ||
<?php | ||
|
||
namespace Convoy\Http\Requests\Admin\Coterms; | ||
|
||
use Convoy\Http\Requests\BaseApiRequest; | ||
|
||
class UpdateAttachedNodesRequest extends BaseApiRequest | ||
{ | ||
public function rules(): array | ||
{ | ||
return [ | ||
'node_ids' => 'required|array', | ||
'nodes_ids.*' => 'required|integer|exists:nodes,id', | ||
]; | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace Convoy\Http\Requests\Admin\Coterms; | ||
|
||
use Convoy\Http\Requests\BaseApiRequest; | ||
use Convoy\Models\Coterm; | ||
use Illuminate\Support\Arr; | ||
|
||
class UpdateCotermRequest extends BaseApiRequest | ||
{ | ||
public function rules(): array | ||
{ | ||
$coterm = $this->parameter('coterm', Coterm::class); | ||
$rules = Coterm::getRulesForUpdate($coterm); | ||
|
||
return Arr::only($rules, ['name', 'is_tls_enabled', 'fqdn', 'port']); | ||
} | ||
} |
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