fix: null-safe role check, enable SQLite test DB, improve TinyMCE paste handling

This commit is contained in:
F4ilji
2026-07-05 22:34:04 +05:00
parent bec37c0e22
commit fd7de347d4
3 changed files with 14 additions and 4 deletions
@@ -20,7 +20,11 @@ class PostNotificationService
public function send(Post $post): void
{
// Находим всех пользователей с ролью "editor"
$editors = Role::findByName('editor')->users;
$role = Role::findByName('editor');
if (!$role) {
return;
}
$editors = $role->users;
// Отправляем уведомление каждому редактору
foreach ($editors as $editor) {
+2 -2
View File
@@ -23,8 +23,8 @@
<env name="APP_ENV" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
<env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_MAILER" value="array"/>
<env name="QUEUE_CONNECTION" value="sync"/>
<env name="SESSION_DRIVER" value="array"/>
@@ -87,12 +87,18 @@ export default {
plugins: [
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount',
'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
'autoresize'
],
invalid_styles: 'all',
paste_as_text: true,
paste_remove_styles: true,
paste_remove_styles_if_webkit: true,
paste_remove_spans: true,
paste_strip_class_attributes: 'all',
paste_merge_formats: true,
paste_word_valid_elements: 'b,strong,i,em,p,br,ul,ol,li,span',
paste_data_images: false,
toolbar: 'undo redo | blocks | ' +
'bold italic forecolor link | alignleft aligncenter ' +
'alignright alignjustify | bullist numlist outdent indent | ' +