CasperSecurity

Current Path : /var/www/orientalss.com/app/Http/Livewire/Header/
Upload File :
Current File : /var/www/orientalss.com/app/Http/Livewire/Header/NotificationLivewire.php

<?php

namespace App\Http\Livewire\Header;

use App\Models\User;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;

class NotificationLivewire extends Component
{
    public $notifications=[];
    public $is_hidden=true;

    protected $listeners=['updateNotification'];

    public function updateNotification()
    {
        $this->getNotifications();
    }

    public function noficiationclick(){
        if($this->is_hidden){
            $this->is_hidden=false;
        }else{
            $this->is_hidden=true;
        }
    }

    public function markasread($keyval,$targeturl){
        $user = User::find(Auth::user()->id);
        if($keyval !=""){
            try{
                $notification=$user->unreadnotifications[$keyval];
                if($notification){
                    $notification->markAsRead();
                    $this->getNotifications();

                }
            }catch (\Exception $e){
                $this->getNotifications();
            }
            if($targeturl !=""){
                $this->redirect($targeturl);
            }


        }
    }

    public function getNotifications(){
        $this->notifications=[];
        $user = User::find(Auth::user()->id);
        foreach ($user->unreadnotifications as $notification) {
           array_push($this->notifications,json_decode($notification,true)) ;
        }
        // dd($this->notifications);
    }
    public function render()
    {
        $this->getNotifications();
        return view('livewire.header.notification-livewire');
    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY