From 9090aeb766600332a1b2fface2a356621a9f08d8 Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Wed, 29 May 2013 18:24:43 +0300 Subject: [PATCH] Catch getType Hopefully fixes #19 --- src/Barryvdh/LaravelIdeHelper/ModelsCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Barryvdh/LaravelIdeHelper/ModelsCommand.php b/src/Barryvdh/LaravelIdeHelper/ModelsCommand.php index 94ce896..bee2db0 100644 --- a/src/Barryvdh/LaravelIdeHelper/ModelsCommand.php +++ b/src/Barryvdh/LaravelIdeHelper/ModelsCommand.php @@ -146,7 +146,12 @@ class ModelsCommand extends Command { if($columns){ foreach ($columns as $column) { $name = $column->getName(); - $type = $column->getType()->getName(); + try{ + $type = $column->getType()->getName(); + }catch(\Exception $e){ + $type = "string"; + $this->info("Could not determine type of column '$name', defaulting to string."); + } switch($type){ case 'string': case 'text':