File "MediaCannotBeDeleted.php"

Full Path: /home/clickysoft/public_html/jmapi5.clickysoft.net/vendor/spatie/laravel-medialibrary/src/MediaCollections/Exceptions/MediaCannotBeDeleted.php
File size: 470 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

namespace Spatie\MediaLibrary\MediaCollections\Exceptions;

use Exception;
use Illuminate\Database\Eloquent\Model;

class MediaCannotBeDeleted extends Exception
{
    public static function doesNotBelongToModel($mediaId, Model $model): self
    {
        $modelClass = $model::class;

        return new static("Media with id `{$mediaId}` cannot be deleted because it does not exist or does not belong to model {$modelClass} with id {$model->getKey()}");
    }
}