<div id="hide_forever">
Div, который прячется навсегда
</div>
<button id="button1">Скрыть DIV</button>
<script>
const div = document.getElementById('hide_forever');
const button = document.getElementById('button1');
const status = localStorage.getItem('div_hidden');
if (status) {
div.style.display = 'none';
}
button.addEventListener('click', () => {
localStorage.setItem('div_hidden', '1');
div.style.display = 'none';
});
</script>
SELECT * FROM users WHERE username=:username
$user = [
'id' => 1,
'username' => 'vasya',
'password' => 'длинный хеш'
]
password_verify($old_password, $user['hash'])
$hash = password_hash($new_password, PASSWORD_DEFAULT);
UPDATE users SET password=:hash WHERE id=$user['id']
<h1>
Hi there! We are the new kids on the block
and we build awesome websites and mobile apps.
</h1>
h1 {
max-width: 600px; // Подобрать, чтобы текст не расползался по всей ширине
margin-left: auto;
margin-right: auto;
text-align: center;
}
@foreach ($roles as $role)
@foreach ($role->categories as $cat)
<td class="text-center">
<div class="form-check">
<input class="form-check-input" name="roles[{{$cat->id}}][]" type="checkbox"
value="{{$role->id}}" @if(in_array($role->id, $category->roles()->pluck('id')->all())) checked @endif>
</div>
</td>
@endforeach
@endforeach
<input class="form-check-input" name="permissions[{{$cat->id}}][{{$role->id}}]" type="checkbox"
value="1" @if(in_array($role->id, $category->roles()->pluck('id')->all())) checked @endif>
li + li {}
Выбирает все элементы кроме первого.li:last-child {}
Выбирает только последний элемент.li:not(:first-child) {}
div > (a + p + p + p)
p + p
выберет последние два параграфаp:not(:first-child)
- все параграфы.