SELECT book_id, COUNT(*) AS likes
FROM likes_books
GROUP BY book_id
ORDER BY likes DESC
LIMIT 5;
$likes = DB::table('likes_books')
->select('book_id', DB::raw('COUNT(*) as likes'))
->groupBy('book_id')
->orderByDesc('likes')
->limit(5)
->get();
DB::table('likes_books')
используете модель(вместо LikeBook своё название) LikeBook::select....
some
function createRange(a, b) {
const range = [];
for (let i = a; i <= b; i++) {
range.push(i);
}
return range;
}
const a = 1;
const b = 7;
const isRangedNumber= createRange(a, b);
let Validator = isRangedNumber.some((valid)=> valid === 5);
console.log(Validator);
form.submit()
if (e.key === 'Enter' && isValid) {
form.submit()
}
document.addEventListener('DOMContentLoaded', function() {
const forms = document.getElementsByTagName('form');
for (let form of forms) {
form.addEventListener('submit', function(event) {
event.preventDefault();
const formId = this.getAttribute('id');
const formNm = document.getElementById(formId);
const formData = new FormData(this);
fetch('mail.php', {
method: 'POST',
body: formData
})
//axios.post('mail.php', { body: formData })
.then(response => response.text())
.then(data => {
formNm.innerHTML = data;
})
.catch(error => {
formNm.innerHTML = error;
});
});
}
});
function getTestIndex(domain, string) {
const regex = new RegExp(`^(?:@|(?:https?://)?(?:www\\.)?${domain}/?(\\w+)?)$`);
const result = regex.exec(string);
return result ? result[1] : null;
}
console.log(getTestIndex('testdomain.com', 'https://testdomain.com/testindex'));
border-radius: 7px;
, если у красного 8px border: 1px solid blue;
использовать box-shadow: 0 0 0 1px blue;
, а если добавить inset
, то будет как border
.#menu path{
stroke: #000;
}
.input-field input:focus + label, .input-field input.filled + label, .input-field textarea:focus + label, .input-field textarea.filled + label{
top: -25px;
font-size: 14px;
padding: 2px 5px;
background: #ff006a;
color: #fff;
border-radius: 4px;
}
[class^="btn-"] {
position: relative;
display: block;
overflow: hidden;
width: 100%;
height: 80px;
max-width: 250px;
margin: 1rem auto;
text-transform: uppercase;
border: 1px solid currentColor;
background: none;
transition: 0.5s ease-in-out;
line-height: 80px;
text-decoration: none;
font-size: 16px;
text-align: center;
}
.btn-p {
color: #804694;
}
.btn-p span {
position: absolute;
display: block;
width: 0;
height: 0;
border-radius: 50%;
background-color: #3f164d;
transition: width 0.4s ease-in-out, height 0.4s ease-in-out;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
z-index: -1;
}
.btn-p:hover {
color: #dac9e0;
}
.btn-p:hover span {
width: 225%;
height: 562.5px;
}
.btn-p:active {
background-color: #692581;
}
.list{
padding: 7px;
border: 1px solid #a2a2a2;
border-bottom: 0;
}
.list:last-child{
border-bottom: 1px solid #a2a2a2;
}
$(".wayWeWork").hover(
function () {
$(this).find("h4").animate({top: '20%',left: '5rem'},300, 'linear');
},
function() {
$(this).find("h4").animate({top: '50%',left: '2rem'},300, 'linear');
});
@media (min-width: 768px){
.hero-right{
display:none;
}
}
<div class="text-sm-center text-md-right text-center">
<a class="btn" href="tel:+7123456789">Позвоните нам</a>
</div>