Sindbad~EG File Manager

Current Path : /proc/self/cwd/app/Listeners/
Upload File :
Current File : //proc/self/cwd/app/Listeners/DeleteShareableLinks.php

<?php

namespace App\Listeners;

use App\ShareableLink;
use Common\Files\Events\FileEntriesDeleted;

class DeleteShareableLinks
{
    /**
     * @var ShareableLink
     */
    private $link;

    /**
     * @param ShareableLink $link
     */
    public function __construct(ShareableLink $link)
    {
        $this->link = $link;
    }

    /**
     * @param  FileEntriesDeleted  $event
     * @return void
     */
    public function handle(FileEntriesDeleted $event)
    {
        if ($event->permanently) {
            $this->link->whereIn('entry_id', $event->entryIds)->delete();
        }
    }
}

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists