{
"requires": true,
"lockfileVersion": 1
}
npm ERR! missing script: build
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-07-13T22_12_05_151Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
12 verbose stack Error: lsf@ dev: `nuxt`
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:314:20)
12 verbose stack at maybeClose (internal/child_process.js:1051:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
return response()
->json([
'message' => $errors_m,
'error' => 1,
], 200);
axios.post(this.url.store,this.edit)
.then((response) => {
if (response.data.error === 0){
$('#create').modal('hide');
this.localizations.push(response);
}
if (response.data.error === 1){
toast.fire({
icon: 'error',
title: response.data.message
});
}
})
.catch(error => {
toast.fire({
icon: 'error',
title: error.message
});
console.log(error);
});
$errors_m = '';
$v = Validator::make($request->all(), [
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'first_name' => ['required', 'string', 'max:255'],
'last_name' => ['required', 'string', 'max:255'],
'phone' => ['required', 'string', 'max:255'],
'name' => ['required', 'string', 'max:255'],
'birth' => ['required'],
'password' => ['required', 'string', 'min:6'],
]);
if ($v->fails())
{
$errors = $v->errors();
foreach ($errors->all() as $error){
$errors_m.= $error;
}
return response()
->json([
'message' => $errors_m,
'error' => 1,
], 200);
}
public function more(Request $request,$content,$type,$tale){
if ($request->ajax()){
$comArray = array();
$moreComments = 0;
$query = Comment::where('content_id', $content)->where('type', '=', $type)->where('parent','=',0)->orderBy('id', 'desc')->skip($tale);
$comments = $query->take(2)->get();
$countComments = $query->get()->count(); //Всего комментариев
$getComments = 2; //По сколько подгружаем
if ($countComments <= 2){ //Если количество оставшихся комменариев меньше либо равно общему количеству
$moreComments = 0;
$getComments = 0;
}else{
$moreComments = $countComments - 2; //Присваем переменно количество оставшихя комментариев
if ($moreComments <= $getComments) $getComments = $moreComments; //Запись вида - показать $getChildrens из $moreChildrens
}
foreach ($comments as $comment) {
$moreChildrens = 0; //Всего дочерних комментариев
$getChildrens = 6; //По сколько подгружаем
$queryChildrens = Comment::where('parent','=', $comment->id);
$childrens = $queryChildrens->take(6)->get();
$count = $queryChildrens->count();
if ($count <= 6){ //Если количество оставшихся комменариев меньше либо равно общему количеству
$moreChildrens = 0;
$getChildrens = 0;
}else{
$moreChildrens = $count - 6; //Присваем переменно количество оставшихя комментариев
if ($moreChildrens <= $getChildrens) $getChildrens = $moreChildrens; //Запись вида - показать $getChildrens из $moreChildrens
}
$comment->childrens = $childrens;
$comment->more_childrens = $moreChildrens;
$comment->get_childrens = $getChildrens;
}
return new CommentCollection($comments, $moreComments);
}
}