From 063e59895ca38484aaa1c54c8429dc4880784d60 Mon Sep 17 00:00:00 2001 From: Barry Date: Mon, 1 Apr 2013 19:15:48 +0200 Subject: [PATCH] Extend the facade class Fixes Issue #1 Only extended when it is not the same as the root class (because of overriding static methods) --- src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php b/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php index eafd546..7899f25 100644 --- a/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php +++ b/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php @@ -139,7 +139,12 @@ class GeneratorCommand extends Command { if($sublime){ $output .= " class $alias extends \\$root{\n"; }else{ - $output .= " class $alias{\n"; + //If the root class is not the same as the facade extend it. + if($root !== $facade){ + $output .= " class $alias extends $facade{\n"; + }else{ + $output .= " class $alias{\n"; + } $output .= "\t/**\n\t * @var \\$root \$root\n\t */\n\t static private \$root;\n\n"; } $methods = $d->getMethods();