|
@@ -41,11 +41,14 @@ class Keyboard extends Controller
|
|
|
public function index()
|
|
public function index()
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- request()->validate([
|
|
|
|
|
- 'title' => ['nullable', 'string'],
|
|
|
|
|
- 'permission_name' => ['nullable', 'string'],
|
|
|
|
|
|
|
+ $search = request()->validate([
|
|
|
|
|
+ 'page' => ['nullable', 'integer', 'min:1'],
|
|
|
|
|
+ 'limit' => ['nullable', 'integer', 'min:1'],
|
|
|
|
|
+ 'button' => ['nullable', 'string'],
|
|
|
|
|
+ 'language' => ['nullable', 'string', 'in:zh,vi,en'],
|
|
|
|
|
+ 'explain' => ['nullable', 'string'],
|
|
|
|
|
+ 'group_id' => ['nullable', 'integer', 'in:0,1'],
|
|
|
]);
|
|
]);
|
|
|
- $search = request()->all();
|
|
|
|
|
$result = KeyboardService::paginate($search);
|
|
$result = KeyboardService::paginate($search);
|
|
|
} catch (ValidationException $e) {
|
|
} catch (ValidationException $e) {
|
|
|
return $this->error(HttpStatus::VALIDATION_FAILED, '', $e->errors());
|
|
return $this->error(HttpStatus::VALIDATION_FAILED, '', $e->errors());
|