-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a03d7f0
commit 4b919ad
Showing
12 changed files
with
223 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\View\Components; | ||
|
||
use Illuminate\View\Component; | ||
|
||
class Notifications extends Component | ||
{ | ||
/** | ||
* Create a new component instance. | ||
* | ||
* @return void | ||
*/ | ||
public $notifications; | ||
public function __construct($notifications) | ||
{ | ||
$this->notifications=$notifications; | ||
} | ||
|
||
/** | ||
* Get the view / contents that represent the component. | ||
* | ||
* @return \Illuminate\Contracts\View\View|\Closure|string | ||
*/ | ||
public function render($render=null) | ||
{ | ||
$notifications=$this->notifications; | ||
return (null!==$render)?view('components.notifications',compact('notifications'))->render():view('components.notifications'); | ||
} | ||
} | ||
|
||
|
||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
@if(isset($notifications)) | ||
@foreach($notifications as $notification) | ||
@php | ||
$bg = $notification['read_at']==null ?"#f1f1f1":"#ffffff"; | ||
@endphp | ||
<li class="mb-2 dropdown-item border-radius-md"> | ||
{{-- <a class="dropdown-item border-radius-md" href="javascript:;" style="background:{{$bg}} ">--}} | ||
<div class="d-flex py-1"> | ||
{{-- <div class="my-auto">--}} | ||
{{-- <img--}} | ||
{{-- --}}{{-- src="./assets/img/team-2.jpg"--}} | ||
{{-- @if(isset($notification['image']) && $notification['image']!=null)--}} | ||
{{-- src="{{$notification['image']}}"--}} | ||
{{-- @else--}} | ||
{{-- src="{{ env('DEFAULT_IMAGE_NOTIFICATION') }}"--}} | ||
{{-- @endif--}} | ||
{{-- class="avatar avatar-sm me-3 ">--}} | ||
{{-- </div>--}} | ||
<div class="d-flex flex-column justify-content-center"> | ||
<h6 class="text-sm font-weight-normal mb-1"> | ||
@if($notification['read_at']==null) | ||
<span | ||
class="font-weight-bold">New Notification</span> | ||
@endif | ||
{!!$notification->data['message']!!} | ||
</h6> | ||
<p class="text-xs text-secondary mb-0"> | ||
<i class="fa fa-clock me-1" aria-hidden="true"></i> | ||
{{\Illuminate\Support\Carbon::parse($notification['created_at'])->diffForHumans()}} | ||
</p> | ||
</div> | ||
</div> | ||
{{-- </a>--}} | ||
</li> | ||
@endforeach | ||
@if(count($notifications)==0) | ||
<li class="mb-2"> | ||
|
||
<div class="d-flex py-1"> | ||
|
||
<div class="d-flex flex-column justify-content-center"> | ||
<h6 class="text-sm font-weight-normal mb-1"> | ||
No Notification | ||
</h6> | ||
|
||
</div> | ||
</div> | ||
|
||
</li> | ||
|
||
@endif | ||
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.