feat: add uploader

This commit is contained in:
JaguarJack
2023-01-11 17:17:36 +08:00
parent 68d378b4ef
commit d823f74015
15 changed files with 457 additions and 9 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace Modules\Common\Repository\Options;
use Exception;
use Illuminate\Support\Str;
class Factory
{
/**
* make
* @param string $optionName
* @return OptionInterface
* @throws Exception
*/
public function make(string $optionName): OptionInterface
{
$className = __NAMESPACE__.'\\'.Str::of($optionName)->ucfirst()->toString();
$class = new $className();
if (! $class instanceof OptionInterface) {
throw new Exception('option must be implement [OptionInterface]');
}
return $class;
}
}