Return YouTube Dislike restores the ability to see dislikes on YouTube.
Starting December 13th 2021, YouTube removed the ability to see dislikes from their API.
This extension aims to restore power to users by using a combination of archived like and dislike data, as well as the likes and dislikes made by extension users to show the most accurate ratings.
Currently has 200+ million videos likes/dislikes data stored before December 13th, 2021
Actively growing and keeping up to date with uploads after December 13th, 2021
The more users that use the extension, the more accurate it will be
и эти соединения не закрываются после обработки запроса.
/**
* Convert a validation exception into a response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Validation\ValidationException $exception
* @return \Illuminate\Http\Response
*/
protected function invalid($request, ValidationException $exception)
{
return redirect($exception->redirectTo ?? url()->previous())
->withInput(Arr::except($request->input(), $this->dontFlash))
->withErrors($exception->errors(), $request->input('_error_bag', $exception->errorBag));
}
public function store(Request $request) {
try{
$valid = $request->validate(
[
'nickname' => ['required','max:64','string'],
'real_name' => ['required','max:64','string'],
'about' => ['required','max:512','string'],
'type' => ['required','integer','max:4'],
'forum_link' => ['required','url'],
'vkontakte' => ['required','url'],
'leaderships' => ['required','string','max:512']
],
[
'nickname.required' => 'Поле никнейм должно быть заполнено',
'nickname.max' => 'Максимум 64 символа',
'nickname.string' => 'Никнейм должен быть строкой',
'real_name.required' => 'Поле имя должно быть заполнено',
'real_name.max' => 'Максимум 64 символа',
'real_name.string' => 'Поле должно быть строкой',
'about.required' => 'Поле должно быть заполнено',
'about.max' => 'Максимум 512 символов',
'about.string' => 'Поле должно быть строкой',
'type.required' => 'Не выбран тип выдвижения',
'vkontakte.required' => 'Не указан вконтакте',
'vkontakte.url' => 'Вконтакте должен быть ссылкой',
'leaderships.required' => 'Лидерства должны быть заполнены',
'leaderships.string' => 'Error',
'leaderships.max' => 'Максимум 512 символов'
]
);
}catch (\Throwable $exception){
dd($exception);
}
Conversation::query()->create([
'user_id' => Auth::id(),
'nickname' => $valid['nickname'],
'about' => $valid['about'],
'real_name' => $valid['real_name'],
'leaderships' => $valid['leaderships'],
'who_close' => null,
'type' => $valid['type'],
'vkontakte' => $valid['vkontakte'],
'forum_link' => $valid['forum_link']
]);
return back()->withErrors($valid);
}
2. Если у вас set null для category_id - то нужен nullable