Start of console commands enhancements

This commit is contained in:
Deon George
2020-01-03 08:04:15 +11:00
parent c5fcfdc1d7
commit cf7c9317eb
6 changed files with 131 additions and 127 deletions

22
app/Traits/Type.php Normal file
View File

@@ -0,0 +1,22 @@
<?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;
}
}