@@ -38,12 +38,10 @@ public static function name_to_db_name($name)
3838 public static function boot ()
3939 {
4040 self ::created (function ($ custom_field ) {
41- \Log::debug ("\n\nCreating Original Name: " .$ custom_field ->name );
42- \Log::debug ('Creating Column Name: ' .$ custom_field ->convertUnicodeDbSlug ());
4341
4442
43+ // column exists - nothing to do here
4544 if (Schema::hasColumn (CustomField::$ table_name , $ custom_field ->convertUnicodeDbSlug ())) {
46- \Log::debug ('Column exists. Nothing to do here. ' );
4745 return false ;
4846 }
4947
@@ -57,18 +55,13 @@ public static function boot()
5755
5856
5957 self ::updating (function ($ custom_field ) {
60- \Log::debug ('Updating column name ' );
61- \Log::debug ('Updating Original Name: ' .$ custom_field ->getOriginal ("name " ));
62- \Log::debug ('Updating New Column Name: ' .$ custom_field ->convertUnicodeDbSlug ());
6358
59+ // Column already exists. Nothing to update.
6460 if ($ custom_field ->isDirty ("name " )) {
6561 if (Schema::hasColumn (CustomField::$ table_name , $ custom_field ->convertUnicodeDbSlug ())) {
66- \Log::debug ('Column already exists. Nothing to update. ' );
6762 return true ;
6863 }
6964
70- \Log::debug ('Updating column name to. ' .$ custom_field ->convertUnicodeDbSlug ());
71-
7265 return Schema::table (CustomField::$ table_name , function ($ table ) use ($ custom_field ) {
7366 $ table ->renameColumn ($ custom_field ->convertUnicodeDbSlug ($ custom_field ->getOriginal ("name " )), $ custom_field ->convertUnicodeDbSlug ());
7467 });
@@ -85,7 +78,7 @@ public static function boot()
8578
8679 public function fieldset ()
8780 {
88- return $ this ->belongsToMany ('\App\Models\CustomFieldset ' ); //?!?!?!?!?!?
81+ return $ this ->belongsToMany ('\App\Models\CustomFieldset ' );
8982 }
9083
9184 public function user ()
@@ -102,10 +95,9 @@ public function check_format($value)
10295 public function db_column_name ()
10396 {
10497 return $ this ->db_column ;
105- // return self::convertUnicodeDbSlug();
10698 }
10799
108- //mutators for 'format' attribute
100+ // mutators for 'format' attribute
109101 public function getFormatAttribute ($ value )
110102 {
111103 foreach (self ::$ PredefinedFormats as $ name => $ pattern ) {
@@ -116,6 +108,13 @@ public function getFormatAttribute($value)
116108 return $ value ;
117109 }
118110
111+ /**
112+ * Format a value string as an array for select boxes and checkboxes.
113+ *
114+ * @author [A. Gianotto] [<[email protected] >] 115+ * @since [v3.4]
116+ * @return Array
117+ */
119118 public function setFormatAttribute ($ value )
120119 {
121120 if (isset (self ::$ PredefinedFormats [$ value ])) {
0 commit comments