Miscellaneous options | laravel-comments | Spatie

 SPATIE

laravel-comments
================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-comments](https://spatie.be/docs/laravel-comments/v1)  Livewire-components  Miscellaneous options

 Version   v2   v1

 Other versions for crawler [v2](https://spatie.be/docs/laravel-comments/v2) [v1](https://spatie.be/docs/laravel-comments/v1)

- [ Introduction ](https://spatie.be/docs/laravel-comments/v1/introduction)
- [ Getting a license ](https://spatie.be/docs/laravel-comments/v1/getting-a-license)
- [ Requirements ](https://spatie.be/docs/laravel-comments/v1/requirements)
- [ Installation &amp; setup ](https://spatie.be/docs/laravel-comments/v1/installation-setup)
- [ Questions and issues ](https://spatie.be/docs/laravel-comments/v1/questions-issues)
- [ Changelog ](https://spatie.be/docs/laravel-comments/v1/changelog)
- [ About us ](https://spatie.be/docs/laravel-comments/v1/about-us)

Basic usage
-----------

- [ Working with comments ](https://spatie.be/docs/laravel-comments/v1/basic-usage/working-with-comments)
- [ Working with reactions ](https://spatie.be/docs/laravel-comments/v1/basic-usage/working-with-reactions)
- [ Transforming comments ](https://spatie.be/docs/laravel-comments/v1/basic-usage/transforming-comments)
- [ Sending notifications ](https://spatie.be/docs/laravel-comments/v1/basic-usage/sending-notifications)
- [ Approving comments ](https://spatie.be/docs/laravel-comments/v1/basic-usage/approving-comments)
- [ Listing comments in Laravel Nova ](https://spatie.be/docs/laravel-comments/v1/basic-usage/listing-comments-in-laravel-nova)

Livewire components
-------------------

- [ Introduction ](https://spatie.be/docs/laravel-comments/v1/livewire-components/introduction)
- [ Installation ](https://spatie.be/docs/laravel-comments/v1/livewire-components/installation)
- [ Using the components ](https://spatie.be/docs/laravel-comments/v1/livewire-components/using-the-components)
- [ Taking care of authorization ](https://spatie.be/docs/laravel-comments/v1/livewire-components/taking-care-of-authorization)
- [ Customising the views ](https://spatie.be/docs/laravel-comments/v1/livewire-components/customising-the-views)
- [ Miscellaneous options ](https://spatie.be/docs/laravel-comments/v1/livewire-components/miscellaneous-options)
- [ Using Markdown ](https://spatie.be/docs/laravel-comments/v1/livewire-components/using-markdown)
- [ Upgrading laravel-comments-livewire ](https://spatie.be/docs/laravel-comments/v1/livewire-components/upgrading)

      You are viewing the documentation for **an older version** of this package. You can check the version you are using with the following command:

 `                                    composer show spatie/laravel-comments                                                                                                                                                                                                                                    `

Miscellaneous options
=====================

###  On this page

1. [ Using another avatar provider ](#content-using-another-avatar-provider)
2. [ Hiding all avatars ](#content-hiding-all-avatars)
3. [ Disable autoDownloadFontawesome of EasyMDE ](#content-disable-autodownloadfontawesome-of-easymde)
4. [ Choosing an editor ](#content-choosing-an-editor)
5. [ Making the comments read only ](#content-making-the-comments-read-only)
6. [ Displaying the newest comments first ](#content-displaying-the-newest-comments-first)
7. [ Customizing the &amp;quot;No comments yet text&amp;quot; ](#content-customizing-the-no-comments-yet-text)
8. [ Only allow top level comments ](#content-only-allow-top-level-comments)

The most powerful way to customize the components, is by [publishing the views](/docs/laravel-comments/v1/livewire-components/customising-the-views) and editing them.

On this page, we'll list various options and ideas.

Using another avatar provider
-----------------------------------------------------------------------------------------------------------------------------------------------

By default, when your commenting user doesn't have an avatar, we'll use [Gravatar](https://en.gravatar.com) as a fallback.

To use another avatar provider, [publish the views](/docs/laravel-comments/v1/livewire-components/customising-the-views), and modify the `avatar.blade.php` view.

Hiding all avatars
--------------------------------------------------------------------------------------------------------------

If you don't want to show any avatars, you can add the `config.ui.show_avatars` option to the `comments` config file

```
// config/comments

return [
    // other options...

    'ui' => [
        'show_avatars' => false,
    ],
];
```

You can also use the `hide-avatars` attribute on the `comments` component.

Disable autoDownloadFontawesome of EasyMDE
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

By default, the Livewire component will autoload the fontawesome icons on the version predifined by EasyMDE. Because this can conflict with your working version of fontawesome you can disable this feature en load the icons yourself. If you want to disable this, you can add the `config.ui.autoload_fontawesome` option to the `comments` config file

```
// config/comments

return [
    // other options...

    'ui' => [
        'autoload_fontawesome' => false,
    ],
];
```

```

```

Choosing an editor
--------------------------------------------------------------------------------------------------------------

By default, we'll use [SimpleMDE](https://simplemde.com) to create and edit comments. Should you want to use a plan textarea, add this to the `comments.php` config file.

```
// config/comments

return [
    // other options...

    'ui' => [
        'editor' => 'comments::editors.textarea',
    ],
];
```

Making the comments read only
-----------------------------------------------------------------------------------------------------------------------------------------------

To disable creating, editing, and deleting comments on component, use `read-only` attribute.

```

```

This can be handy to have fine-grained control over which user should be able to post comments for a certain model. Let's assume that you've implemented a method `canPostComment` on your used model that will return `true` if the user is allowed to comment on a given `$post`

```
@if(auth()->user()->canPostComment($post))

@else

    You are not allow to post new comments on this post.
@endif
```

Displaying the newest comments first
--------------------------------------------------------------------------------------------------------------------------------------------------------------------

By default, the components show the oldest comments first. If you want to show the newest comments first, pass the `newest-first` attribute.

```

```

Customizing the "No comments yet text"
----------------------------------------------------------------------------------------------------------------------------------------------------------------------

You can customize that text that displayed when there are no comments yet but publishing the translations and editing the `no_comments_yet` yet key in the `comments` language file.

You can also customize this text per component by passing in a string to the `no-comments-text` prop.

```

```

Only allow top level comments
-----------------------------------------------------------------------------------------------------------------------------------------------

By default, the Livewire components will allow two levels of comments. A comment on a comment is called a reply. If you want to disable replies, pass the `no-replies` attribute.

```

```
