[ 'display_name' => 'Phone number', 'options' => [ [ 'name' => 'Replace with', 'type' => 'select', 'values' => [ '#', '*', 'x' ] ] ] ], 'email' => [ 'display_name' => 'Email', 'options' => [ [ 'name' => 'Replace with', 'type' => 'select', 'values' => [ '#', '*', 'x' ] ], [ 'name' => 'Include domain', 'type' => 'switch' ] ] ] ]; /** * Create a new filter * * @return JsonResponse * * @throws BindingResolutionException */ public function create(): JsonResponse { return response()->json([ 'result' => 'success' ]); } /** * Get one or all the filters we have * * @param string|null $id The ID of the filter. Null if we want all of them * * @return JsonResponse * * @throws BindingResolutionException */ public function get(string $id = null): JsonResponse { if ($id === null) { return response()->json(static::$filters); } if (!empty(static::$filters[$id])) { return response()-> json(static::$filters[$id]); } abort(404); } }