diff --git a/app/Util/Media/License.php b/app/Util/Media/License.php index 653013a4..835a0acc 100644 --- a/app/Util/Media/License.php +++ b/app/Util/Media/License.php @@ -120,4 +120,19 @@ class License { ->values() ->toArray(); } + + public static function nameToId($name) + { + $license = collect(self::get()) + ->filter(function($l) use($name) { + return $l['title'] == $name; + }) + ->first(); + + if(!$license || $license['id'] < 2) { + return null; + } + + return $license['id']; + } }