Crud: Notifications

Created on 18 Mar 2018  路  2Comments  路  Source: Laravel-Backpack/CRUD

Bug report

What I did:

i want to know if there a library for backpack for manage notifications ?

What I expected to happen:

adding icon in the top bar to count notification that comes to the panel

What happened:

What I've already tried to fix it:

Backpack, Laravel, PHP, DB version:

question

Most helpful comment

This belongs more to base however @iMokhles has provided a good answer here.

Backpack base uses Prologue/Alert to handle alerts if that is what is being discussed - these are the things used to put up the deleted successfully and such messages.

You probably should look at:

That said, this is more a support question and I'll close it as such.

Feel free to ask us on gitter.

All 2 comments

before anything you need to run

php artisan notifications:table
php artisan migrate

after that add notification menu manually

Edit this file

resources/views/vendor/backpack/base/inc/menu.blade.php

to add something like that

<!-- Notifications: style can be found in dropdown.less -->
<li class="dropdown notifications-menu">
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
        <i class="fa fa-bell-o"></i>
        <span class="label label-warning">{{\App\Helpers\AdminHelper::unreadNotificationsCount()}}</span>
    </a>
    <ul class="dropdown-menu">
        <li class="header">You have {{\App\Helpers\AdminHelper::unreadNotificationsCount()}} notifications</li>
        @if(\App\Helpers\AdminHelper::unreadNotificationsCount() > 0)
            <li>
                <!-- inner menu: contains the actual data -->
                <ul class="menu">
                    @foreach (\App\Helpers\AdminHelper::unreadNotifications() as $notification)
                        <li>
                            <a href="{{$notification->markAsRead()}}">
                                <i class="fa {{$notification['data']['icon']}} text-aqua"></i> {{$notification['data']['message']}}
                            </a>
                        </li>
                    @endforeach
                </ul>
            </li>
            <li class="footer"><a href="#">View all</a></li>
        @endif
    </ul>
</li>

under

<!-- ========== Top menu right items (ordered left) ========== -->
<!-- ========================================================= -->

AdminHelper.php source

This belongs more to base however @iMokhles has provided a good answer here.

Backpack base uses Prologue/Alert to handle alerts if that is what is being discussed - these are the things used to put up the deleted successfully and such messages.

You probably should look at:

That said, this is more a support question and I'll close it as such.

Feel free to ask us on gitter.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sonoftheweb picture sonoftheweb  路  3Comments

sseggio picture sseggio  路  3Comments

packytagliaferro picture packytagliaferro  路  3Comments

voidstate picture voidstate  路  3Comments

abewartech picture abewartech  路  3Comments