mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
* [LARAVEL 8] include_factory_builders does not work anymore (#1047) * Change skip expression Append comment about deprecated to config file Append comment about deprecated to README file
This commit is contained in:
+14
-7
@@ -12,18 +12,25 @@ class Factories
|
||||
{
|
||||
$factories = [];
|
||||
|
||||
$factory = app(Factory::class);
|
||||
if (static::isLaravelSevenOrLower()) {
|
||||
$factory = app(Factory::class);
|
||||
|
||||
$definitions = (new ReflectionClass(Factory::class))->getProperty('definitions');
|
||||
$definitions->setAccessible(true);
|
||||
$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) {
|
||||
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