From 62deba4171de14b4abcff71edb807690e9add6e8 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 4 Jun 2013 14:12:47 +0200 Subject: [PATCH] Make builder work for relations Fixes #22 --- src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php b/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php index 31cd4e6..1a3629a 100755 --- a/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php +++ b/src/Barryvdh/LaravelIdeHelper/GeneratorCommand.php @@ -53,7 +53,7 @@ class GeneratorCommand extends Command { public function fire() { if (file_exists($compiled = base_path().'/bootstrap/compiled.php')){ - $this->error('Error: first delete bootstrap/compiled.php (php artisan clear-compiled)'); + $this->error('Error generating IDE Helper: first delete bootstrap/compiled.php (php artisan clear-compiled)'); }else{ $filename = $this->argument('filename'); @@ -318,6 +318,8 @@ namespace {\n\tdie('Only to be used as an helper for your IDE');\n}\n\n"; $returnValue = "static"; }elseif(!$this->sublime and $alias == 'Eloquent' and in_array($method->name, array('all', 'get'))){ $returnValue .= "|\Eloquent[]|static[]"; + }elseif($alias == 'Eloquent' and in_array($method->name, array('hasOne', 'hasMany', 'belongsTo', 'belongsToMany', 'morphOne', 'morphTo', 'morphMany'))){ + $returnValue .= "|\Eloquent"; } $tag->setContent($returnValue . " ". $tag->getDescription()); }else{