use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Contracts\Validation\Validator;protected function failedValidation(Validator $validator)
{
throw new HttpResponseException(response()->json(
[
'errors' => $validator->errors(),
'status' => true
],
400
));
}

Please note that iconv('UTF-8', 'ASCII//TRANSLIT', ...) doesn't work properly when locale category LC_CTYPE is set to C or POSIX. You must choose another locale otherwise all non-ASCII characters will be replaced with question marks. This is at least true with glibc 2.5.
input = document.querySelector('#my');
input.value = 'Вставляемый текст';
input.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true }));
input.dispatchEvent(new KeyboardEvent('keypress', { bubbles: true }));
input.dispatchEvent(new KeyboardEvent('keyup', { bubbles: true }));
input.dispatchEvent(new Event('input', { bubbles: true }));
input.dispatchEvent(new Event('change', { bubbles: true })); cat sites.json | jq -r '.sites[] | "\(.title)\tadmin\t\(.admin[])\n\(.title)\tfront\t\(.front[])"' | sort -u | fzf -m --delimiter "\t" --nth 1,2 | awk '{print $3}'#!/bin/bash
select site in $(jq -r '.sites[].title' sites.json)
do
select area in "admin" "front"
do
# get links for "area"
links=$(jq '.sites[] | select(.title == "'${site}'") | .'${area}' |.[]' sites.json)
# here you can do whatever you want - iterate through links, opening them with xdg-open, or just print them out
echo $links
break
done
break;
doneselect area in "admin" "front"select area in $(jq -r '.sites[] | select(.title == "'${site}'") | keys | .[] | select(. != "title")' sites.json) for a in 1 2; do
for b in 1 3; do
select list; do
while something; do
break
done
done
done
donejsonlist="$(jq '.[][]|keys[]' sites.json|tr -d \")"
select action in ${jsonlist};do
echo "[$action]"
test "$action" == "title" && break
newlist="$(jq ".[][][\"$action\"][]" sites.json)"
echo "$newlist"
done awk -F: '
/\{|\}|border|max-width|^$/ { print $0 }
!/\{|\}|border|max-width|^$/ {
split( substr($2, 1, length($2)-1) , a," ");
res = "";
for (i in a) {
ind = match(a[i], /[0-9]+px/)
if (ind != 0) {
a[i] = sprintf ("%.2frem", a[i]/10);
}
res=a[i] " " res;
}
res = substr(res, 1, length(res)-1);
print $1 ": " res ";"
}
' some.cssArrays in awk are different—they are associative. This means that each array is a collection of pairs—an index and its corresponding array element value...
The pairs are shown in jumbled order because their order is irrelevant.
awk -F: '{
if ($0 ~ /\{|\}|border|max-width|^$/ ) { print $0 }
else {
res = "";
split( substr($2, 1, length($2)-1) , a, " ");
for (i=1; i<= length(a);i++) res = res " " ((match(a[i], /[0-9]+px/) != 0)? a[i]/10"rem" : a[i]);
print $1 ": " res";"
}
}' some.css