var currentEl;
window.onscroll = function(){
document.querySelectorAll("[data-y]").forEach(el => {
if ( el.scrollHeight >= window.scrollY ) currentEl = el;
})
}
$posts = Post::where('type', 'post')->join('news_categories', 'posts.category_id', '=', 'news_category.id')->select('posts.id','posts.category_id','posts.title','posts.slug','posts.created_at','news_categories.category_name')->orderBy('posts.id', 'desc')->paginate(20);
return view('admin.news.posts', compact('posts'));
let form = document.createElement('form');
form.action = 'maxage.php';
form.method = 'POST';
form.innerHTML = `
<input name="name" value="<?=$_POST['name']" hidden>
<input name="age" value="<?=$_POST['age']" hidden>`;
// перед отправкой формы, её нужно вставить в документ
document.body.append(form);
form.submit();