Subiendo proyecto completo sin restricciones de git ignore
This commit is contained in:
36
vendor/barryvdh/laravel-ide-helper/src/Factories.php
vendored
Normal file
36
vendor/barryvdh/laravel-ide-helper/src/Factories.php
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace Barryvdh\LaravelIdeHelper;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Database\Eloquent\Factory;
|
||||
use ReflectionClass;
|
||||
|
||||
class Factories
|
||||
{
|
||||
public static function all()
|
||||
{
|
||||
$factories = [];
|
||||
|
||||
if (static::isLaravelSevenOrLower()) {
|
||||
$factory = app(Factory::class);
|
||||
|
||||
$definitions = (new ReflectionClass(Factory::class))->getProperty('definitions');
|
||||
$definitions->setAccessible(true);
|
||||
|
||||
foreach ($definitions->getValue($factory) as $factory_target => $config) {
|
||||
try {
|
||||
$factories[] = new ReflectionClass($factory_target);
|
||||
} catch (Exception $exception) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $factories;
|
||||
}
|
||||
|
||||
protected static function isLaravelSevenOrLower()
|
||||
{
|
||||
return class_exists('Illuminate\Database\Eloquent\Factory');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user