diff src/Generator/Model/stubs/model.stub @ 29:010ace248d14 codex

Added support for filters, not fully there with relations or anything like that but it's a start
author Luka Sitas <sitas.luka.97@gmail.com>
date Mon, 09 Jun 2025 20:51:04 -0400
parents f88d2d5dee30
children 8dd668020310
line wrap: on
line diff
--- a/src/Generator/Model/stubs/model.stub	Mon Jun 09 19:51:31 2025 -0400
+++ b/src/Generator/Model/stubs/model.stub	Mon Jun 09 20:51:04 2025 -0400
@@ -2,11 +2,9 @@
 
 namespace {{ namespace }};
 
-use Illuminate\Database\Eloquent\Factories\HasFactory;
-use Illuminate\Database\Eloquent\Model;
 use Illuminate\Database\Eloquent\SoftDeletes;
 
-class {{ class }} extends Model
+class {{ class }} extends BaseModel
 {
     //use HasFactory;
     use SoftDeletes;
@@ -35,7 +33,7 @@
 			# {{ defaultRelationsInsertPoint }}
 		];
 
-		protecte static $filters = [
+		protected static $filters = [
 			# {{ defaultFiltersInsertPoint }}
 		];
 
@@ -67,22 +65,6 @@
 			return $this;
 		}
 
-		//MARK FOR MODEL
-		protected static function load_auxilary_data() {
-			$data = [];
-
-			$instance = new static();
-		
-		  foreach($instance->default_relations as $relation) {
-				$related_model = $instance->$relation()->getRelated();
-				$related_table = $related_model->getTable();
-				$data[$related_table] = $related_model->all()->pluck('name','id')->toArray();
-			}
-
-			return $data;
-		}
-
-
 		/**
 		 * Retrieve a query builder instance with default relations loaded.
 		 *