<?php

namespace {{ namespace }};

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Wizard\Framework\Models\BaseModel;

class {{ class }} extends BaseModel
{
		/** @use HasFactory<\Database\Factories\{{ class }}Factory> */
    use HasFactory;
    use SoftDeletes;

    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = '{{ tableName }}';

		/**
     * The model's default values for attributes.
     *
     * @var array
     */
    protected $attributes = [
			# {{ atributeInsertPoint }}
    ];

		protected $casts = [
			# {{ castInsertPoint }}
		];

		protected $fillable = [
			# {{ fillableInsertPoint }}
		];

		protected $default_relations = [
			# {{ defaultRelationsInsertPoint }}
		];

		protected static $filters = [
			# {{ defaultFiltersInsertPoint }}
		];

		public static function get_filters() {
			return static::filters;
		}

		//relations

		// BelongsTo
		# {{ belongs_to_relationships }}

		// HasMany
		# {{ has_many_relationships }}
		
    // HasManyThrough
		# {{ has_many_through_relationships }}


		/**
		 * Load the default relations for the model.
		 *
		 * @return $this
		 */
		public function load_relations() {
			foreach($this->default_relations as $relation) {
				$this->load($relation);
			}
			return $this;
		}

		/**
		 * Retrieve a query builder instance with default relations loaded.
		 *
		 * @return \Illuminate\Database\Eloquent\Builder
		 */
		public static function data_query() {
			return parent::data_query();
		}

		/**
     * Retrieve a query builder instance with default relations loaded.
     *
     * @return \Illuminate\Database\Eloquent\Builder
     */
    public static function get_data(array $validated = [])
    {
        return parent::get_data($validated);
    }

}
