22 lines
322 B
PHP
22 lines
322 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
/**
|
|
* Trait Files
|
|
* This will return a valid Model Object.
|
|
*
|
|
* @package App\Traits
|
|
*/
|
|
trait Type
|
|
{
|
|
private function getModelType(string $type): string
|
|
{
|
|
$class = 'App\Models\\'.$type;
|
|
|
|
if (! class_exists($class))
|
|
abort(500,sprintf('No class [%s]',$type));
|
|
|
|
return $class;
|
|
}
|
|
} |