Current File : //home/tradevaly/public_html/resources/views/backend/pages/notification/index.blade.php
@extends('backend.ayaan.master')


@push('title','Notifications')

@push('style')

@endpush

@section('content')
<div class="main-content">
<div class="container-fluid">
    <div class="page-content">
        <div class="container-fluid">

            <!-- start page title -->
            <div class="row">
                <div class="col-12">
                    <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                        <h4 class="mb-sm-0 font-size-18">Notifications</h4>

                        <div class="page-title-right">
                            <ol class="breadcrumb m-0">
                                <li class="breadcrumb-item"><a href="javascript: void(0);">Email</a></li>
                                <li class="breadcrumb-item active">Notifications</li>
                            </ol>
                        </div>

                    </div>
                </div>
            </div>
            <!-- end page title -->

            <div class="row">
                <div class="col-md-8 mx-auto">
                    <div class="card">
                        <div class="card-header">
                            <h2>Notifications</h2>
                        </div>
                        <div class="card-body">
                                @foreach($notifications as $notification)
                                <div class="alert alert-primary d-flex justify-content-between" role="alert">
                                    <a href="
                                         @if($notification->type=="inquery")
                                        @php
                                            $pdata = \App\Models\BuyOffer::where('id',$notification->data)->first();
                                        @endphp
                                        @if(isset($pdata))
                                        {{route('admin.buy_offer.view',$pdata->id)}}
                                        @endif
                                        @endif
                                        @if($notification->type=="new product")
                                        @php
                                            $pdata = \App\Models\Product::where('id',$notification->data)->first();
                                        @endphp
                                        @if(isset($pdata))
                                        {{route('admin.product.pview',$pdata->slug)}}
                                        @endif
                                        @endif
                                        
                                        @if($notification->type=="order")
                                        {{route('admin.order.view',$notification->data)}}
                                        @endif
                                        ">
                                        @if($notification->seen==null)
                                            <strong>{{$notification->user->name." ".$notification->message}}</strong>
                                        @else
                                            {{$notification->user->name." ".$notification->message}}
                                        @endif
                                    </a>
                                    <a href="{{route('admin.notification.del',$notification->id)}}">Delete</a>
                                </div>
                                @endforeach
                            </u>
                        </div>
                    </div>
                </div>
            </div><!-- End row -->

        </div> <!-- container-fluid -->
    </div>
</div>
</div>

@push('script')