From 4069863d0c834291513941c2897c086bdda2d809 Mon Sep 17 00:00:00 2001 From: Sergius Date: Tue, 12 Jan 2016 15:33:05 +0200 Subject: [PATCH] Add extend \Eloquent for ide-helper:models command It's help author to close many issues! ) Like: #269, #259, #248, #209, #191, #74, and https://github.com/laravel/framework/issues/7558 ))) etc. maybe --- src/Console/ModelsCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index d93325a..57e393d 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -484,6 +484,10 @@ class ModelsCommand extends Command $phpdoc->appendTag($tag); } + if ($this->write) { + $phpdoc->appendTag(Tag::createInstance("@mixin \\Eloquent", $phpdoc)); + } + $serializer = new DocBlockSerializer(); $serializer->getDocComment($phpdoc); $docComment = $serializer->getDocComment($phpdoc); @@ -507,7 +511,7 @@ class ModelsCommand extends Command } } - $output = "namespace {$namespace}{\n{$docComment}\n\tclass {$classname} {}\n}\n\n"; + $output = "namespace {$namespace}{\n{$docComment}\n\tclass {$classname} extends \Eloquent {}\n}\n\n"; return $output; }