mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
18 lines
436 B
PHP
18 lines
436 B
PHP
<?php
|
|
namespace App\Helpers;
|
|
|
|
use Jenssegers\Mongodb\Eloquent\Model;
|
|
|
|
abstract class Guards
|
|
{
|
|
/**
|
|
* @throws \InvalidArgumentException
|
|
*/
|
|
static function shouldBeMongoDbModel(object|string $modelClass): void
|
|
{
|
|
if (!in_array(Model::class, class_parents($modelClass))) {
|
|
throw new \InvalidArgumentException("$modelClass should inherit from \Jenssegers\Mongodb\Eloquent\Model.");
|
|
}
|
|
}
|
|
}
|